|
43 | 43 |
|
44 | 44 | import static java.net.InetAddress.getByName;
|
45 | 45 | import static java.util.Arrays.asList;
|
46 |
| -import static org.opensearch.transport.TcpTransport.resolvePublishPort; |
47 | 46 | import static org.hamcrest.Matchers.equalTo;
|
48 | 47 |
|
49 | 48 | public class PublishPortTests extends OpenSearchTestCase {
|
@@ -72,43 +71,43 @@ public void testPublishPort() throws Exception {
|
72 | 71 |
|
73 | 72 | }
|
74 | 73 |
|
75 |
| - int publishPort = resolvePublishPort( |
| 74 | + int publishPort = Transport.resolvePublishPort( |
76 | 75 | new TcpTransport.ProfileSettings(settings, profile).publishPort,
|
77 | 76 | randomAddresses(),
|
78 | 77 | getByName("127.0.0.2")
|
79 | 78 | );
|
80 | 79 | assertThat("Publish port should be explicitly set", publishPort, equalTo(useProfile ? 9080 : 9081));
|
81 | 80 |
|
82 |
| - publishPort = resolvePublishPort( |
| 81 | + publishPort = Transport.resolvePublishPort( |
83 | 82 | new TcpTransport.ProfileSettings(baseSettings, profile).publishPort,
|
84 | 83 | asList(address("127.0.0.1", boundPort), address("127.0.0.2", otherBoundPort)),
|
85 | 84 | getByName("127.0.0.1")
|
86 | 85 | );
|
87 | 86 | assertThat("Publish port should be derived from matched address", publishPort, equalTo(boundPort));
|
88 | 87 |
|
89 |
| - publishPort = resolvePublishPort( |
| 88 | + publishPort = Transport.resolvePublishPort( |
90 | 89 | new TcpTransport.ProfileSettings(baseSettings, profile).publishPort,
|
91 | 90 | asList(address("127.0.0.1", boundPort), address("127.0.0.2", boundPort)),
|
92 | 91 | getByName("127.0.0.3")
|
93 | 92 | );
|
94 | 93 | assertThat("Publish port should be derived from unique port of bound addresses", publishPort, equalTo(boundPort));
|
95 | 94 |
|
96 |
| - int resPort = resolvePublishPort( |
| 95 | + int resPort = Transport.resolvePublishPort( |
97 | 96 | new TcpTransport.ProfileSettings(baseSettings, profile).publishPort,
|
98 | 97 | asList(address("127.0.0.1", boundPort), address("127.0.0.2", otherBoundPort)),
|
99 | 98 | getByName("127.0.0.3")
|
100 | 99 | );
|
101 | 100 | assertThat("as publish_port not specified and non-unique port of bound addresses", resPort, equalTo(-1));
|
102 | 101 |
|
103 |
| - publishPort = resolvePublishPort( |
| 102 | + publishPort = Transport.resolvePublishPort( |
104 | 103 | new TcpTransport.ProfileSettings(baseSettings, profile).publishPort,
|
105 | 104 | asList(address("0.0.0.0", boundPort), address("127.0.0.2", otherBoundPort)),
|
106 | 105 | getByName("127.0.0.1")
|
107 | 106 | );
|
108 | 107 | assertThat("Publish port should be derived from matching wildcard address", publishPort, equalTo(boundPort));
|
109 | 108 |
|
110 | 109 | if (NetworkUtils.SUPPORTS_V6) {
|
111 |
| - publishPort = resolvePublishPort( |
| 110 | + publishPort = Transport.resolvePublishPort( |
112 | 111 | new TcpTransport.ProfileSettings(baseSettings, profile).publishPort,
|
113 | 112 | asList(address("0.0.0.0", boundPort), address("127.0.0.2", otherBoundPort)),
|
114 | 113 | getByName("::1")
|
|
0 commit comments