Skip to content

Commit b6dad2b

Browse files
2 @before methods, not a good idea (#108502)
Fixes IpFilterRemoteAddressFilterTests testThatFilteringWorksByIp. There were 2 "@ Before"-annotated methods that didn't play well together. Fixes: #108441
1 parent 572ce11 commit b6dad2b

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/transport/netty4/IpFilterRemoteAddressFilterTests.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,6 @@ public class IpFilterRemoteAddressFilterTests extends ESTestCase {
4141
private IpFilterRemoteAddressFilter handler;
4242
private ThreadPool threadPool;
4343

44-
@Override
45-
@Before
46-
public void setUp() throws Exception {
47-
super.setUp();
48-
this.threadPool = new TestThreadPool(getTestName());
49-
}
50-
5144
@After
5245
public void terminate() throws Exception {
5346
terminate(threadPool);
@@ -95,14 +88,14 @@ public void init() throws Exception {
9588
ipFilter.setBoundHttpTransportAddress(httpTransport.boundAddress());
9689
}
9790

91+
this.threadPool = new TestThreadPool(getTestName());
9892
if (isHttpEnabled) {
9993
handler = new IpFilterRemoteAddressFilter(ipFilter, IPFilter.HTTP_PROFILE_NAME, threadPool.getThreadContext());
10094
} else {
10195
handler = new IpFilterRemoteAddressFilter(ipFilter, "default", threadPool.getThreadContext());
10296
}
10397
}
10498

105-
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/108441")
10699
public void testThatFilteringWorksByIp() throws Exception {
107100
InetSocketAddress localhostAddr = new InetSocketAddress(InetAddresses.forString("127.0.0.1"), 12345);
108101
assertThat(handler.accept(mock(ChannelHandlerContext.class), localhostAddr), is(true));

0 commit comments

Comments
 (0)