Skip to content

Commit 563663e

Browse files
committed
test: remove empty EndpointTest.java (fix accidental PR changes)
1 parent 9b0be32 commit 563663e

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

sentinel-transport/sentinel-transport-common/src/test/java/com/alibaba/csp/sentinel/transport/endpoint.EndpointTest.java

Whitespace-only changes.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
package com.alibaba.csp.sentinel.transport.endpoint;
2+
3+
import static org.junit.Assert.assertEquals;
4+
5+
import org.junit.Test;
6+
7+
public class EndpointTest {
8+
@Test
9+
public void testToStringIPv4() {
10+
Endpoint e = new Endpoint(Protocol.HTTP, "127.0.0.1", 8080);
11+
assertEquals("Endpoint{protocol=HTTP, host='127.0.0.1', port=8080}", e.toString());
12+
}
13+
14+
@Test
15+
public void testToStringIPv6() {
16+
Endpoint e = new Endpoint(Protocol.HTTP, "fe80::1", 8080);
17+
// Endpoint#toString doesn't modify the host, so IPv6 remains unbracketed
18+
assertEquals("Endpoint{protocol=HTTP, host='fe80::1', port=8080}", e.toString());
19+
}
20+
21+
@Test
22+
public void testToStringAlreadyBracketed() {
23+
Endpoint e = new Endpoint(Protocol.HTTPS, "[fe80::2]", 443);
24+
assertEquals("Endpoint{protocol=HTTPS, host='[fe80::2]', port=443}", e.toString());
25+
}
26+
27+
@Test
28+
public void testToStringNullHost() {
29+
Endpoint e = new Endpoint(Protocol.HTTP, null, 0);
30+
assertEquals("Endpoint{protocol=HTTP, host='null', port=0}", e.toString());
31+
}
32+
}

0 commit comments

Comments
 (0)