Skip to content

Commit cd2c1a6

Browse files
committed
test(transport): align unresolved endpoint guard contract
1 parent 3d34160 commit cd2c1a6

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

‎src/test/java/io/github/easy4j/hermes/util/EndpointGuardTest.java‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,9 @@ void shouldAllowPublicIpv6Literal() {
135135
}
136136

137137
@Test
138-
void shouldAllowWhenDnsCannotResolve() {
139-
// DNS 未解析主机放行:CI(严格 DNS)走 UnknownHostException 分支,
140-
// 本地(通配 DNS)走解析后非公网判定——两条路径都不抛异常。
141-
assertDoesNotThrow(() -> EndpointGuard.require("https://api.example.com/v1"));
138+
void shouldRejectWhenDnsCannotResolve() {
139+
assertThrows(IllegalArgumentException.class,
140+
() -> EndpointGuard.require("https://hermes-endpoint-does-not-exist.invalid/v1"));
142141
}
143142

144143
@Test

0 commit comments

Comments
 (0)