Skip to content

Commit 26166a4

Browse files
committed
Use a TestThreadPool
1 parent 1fe8e97 commit 26166a4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

server/src/test/java/org/elasticsearch/discovery/UnicastConfiguredHostsResolverTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import org.elasticsearch.common.transport.TransportAddress;
2424
import org.elasticsearch.common.util.concurrent.EsExecutors;
2525
import org.elasticsearch.test.ESTestCase;
26+
import org.elasticsearch.threadpool.TestThreadPool;
2627
import org.elasticsearch.threadpool.ThreadPool;
2728
import org.elasticsearch.transport.TransportService;
2829
import org.junit.After;
@@ -49,15 +50,14 @@ public class UnicastConfiguredHostsResolverTests extends ESTestCase {
4950

5051
@Before
5152
public void startResolver() {
52-
final Settings settings = Settings.builder().put(NODE_NAME_SETTING.getKey(), "node").build();
53-
threadPool = new ThreadPool(settings);
53+
threadPool = new TestThreadPool("node");
5454
transportAddresses = new ArrayList<>();
5555

5656
TransportService transportService = mock(TransportService.class);
5757
when(transportService.getThreadPool()).thenReturn(threadPool);
5858

5959
unicastConfiguredHostsResolver
60-
= new UnicastConfiguredHostsResolver(settings, transportService, hostsResolver -> transportAddresses);
60+
= new UnicastConfiguredHostsResolver(Settings.EMPTY, transportService, hostsResolver -> transportAddresses);
6161
unicastConfiguredHostsResolver.start();
6262
}
6363

0 commit comments

Comments
 (0)