Skip to content

Commit 68af84a

Browse files
author
Paras Jain
committed
Fixed BaseStreamTests and BytesStreamsTests for InetSocketAddress
Signed-off-by: Paras Jain <parasjaz@amazon.com>
1 parent a7a259b commit 68af84a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

server/src/test/java/org/opensearch/common/io/stream/BaseStreamTests.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ public void testMapIsWriteable() throws IOException {
516516
}
517517

518518
public void testInetSocketAddress() throws IOException {
519-
InetSocketAddress toWrite = new InetSocketAddress(InetAddress.getLocalHost(), 80);
519+
InetSocketAddress toWrite = new InetSocketAddress(InetAddress.getLoopbackAddress(), 80);
520520
BytesStreamOutput out = new BytesStreamOutput();
521521
out.writeGenericValue(toWrite);
522522
assertEquals(toWrite, getStreamInput(out.bytes()).readGenericValue());

server/src/test/java/org/opensearch/common/io/stream/BytesStreamsTests.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ public void testSimpleStreams() throws Exception {
313313
float[] floatArray = { 1.1f, 2.2f, 3.3f };
314314
out.writeGenericValue(floatArray);
315315
double[] doubleArray = { 1.1, 2.2, 3.3 };
316-
InetSocketAddress inetSocketAddress = new InetSocketAddress(InetAddress.getLocalHost(), 80);
316+
InetSocketAddress inetSocketAddress = new InetSocketAddress(InetAddress.getLoopbackAddress(), 80);
317317
out.writeGenericValue(doubleArray);
318318
out.writeString("hello");
319319
out.writeString("goodbye");

0 commit comments

Comments
 (0)