diff --git a/server/src/test/java/org/elasticsearch/persistent/PersistentTasksCustomMetaDataTests.java b/server/src/test/java/org/elasticsearch/persistent/PersistentTasksCustomMetaDataTests.java index 58d109c46c31e..c25ca3cb7db63 100644 --- a/server/src/test/java/org/elasticsearch/persistent/PersistentTasksCustomMetaDataTests.java +++ b/server/src/test/java/org/elasticsearch/persistent/PersistentTasksCustomMetaDataTests.java @@ -39,7 +39,6 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.transport.TransportAddress; import org.elasticsearch.common.xcontent.NamedXContentRegistry; import org.elasticsearch.common.xcontent.ToXContent; import org.elasticsearch.common.xcontent.XContentBuilder; @@ -55,7 +54,6 @@ import org.elasticsearch.test.AbstractDiffableSerializationTestCase; import java.io.IOException; -import java.net.InetAddress; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; @@ -325,7 +323,7 @@ public void testDisassociateDeadNodes_givenNoPersistentTasks() { public void testDisassociateDeadNodes_givenAssignedPersistentTask() { DiscoveryNodes nodes = DiscoveryNodes.builder() - .add(new DiscoveryNode("node1", new TransportAddress(InetAddress.getLoopbackAddress(), 9300), Version.CURRENT)) + .add(new DiscoveryNode("node1", buildNewFakeTransportAddress(), Version.CURRENT)) .localNodeId("node1") .masterNodeId("node1") .build(); @@ -349,7 +347,7 @@ public void testDisassociateDeadNodes_givenAssignedPersistentTask() { public void testDisassociateDeadNodes() { DiscoveryNodes nodes = DiscoveryNodes.builder() - .add(new DiscoveryNode("node1", new TransportAddress(InetAddress.getLoopbackAddress(), 9300), Version.CURRENT)) + .add(new DiscoveryNode("node1", buildNewFakeTransportAddress(), Version.CURRENT)) .localNodeId("node1") .masterNodeId("node1") .build();