Test: Fix IndexAuditTrailMutedTests to set the threadpool

The IndexAuditTrailMutedTests have a threadpool but fail to set it on the test client, which causes
a NPE and tests to fail.

Original commit: elastic/x-pack-elasticsearch@d34a4ce080
This commit is contained in:
jaymode 2017-04-05 13:46:38 -04:00
parent 16f5f44d41
commit 7efc9e1270
2 changed files with 8 additions and 4 deletions

View File

@ -310,7 +310,10 @@ public class IndexAuditTrail extends AbstractComponent implements AuditTrail, Cl
}); });
} else if (master) { } else if (master) {
putTemplate(customAuditIndexSettings(settings), ActionListener.wrap((v) -> innerStart(), putTemplate(customAuditIndexSettings(settings), ActionListener.wrap((v) -> innerStart(),
(e) -> state.set(State.FAILED))); (e) -> {
logger.error("failed to put audit trail template", e);
state.set(State.FAILED);
}));
} else { } else {
innerStart(); innerStart();
} }

View File

@ -62,9 +62,10 @@ public class IndexAuditTrailMutedTests extends ESTestCase {
transportClient = new MockTransportClient(Settings.EMPTY); transportClient = new MockTransportClient(Settings.EMPTY);
clientCalled = new AtomicBoolean(false); clientCalled = new AtomicBoolean(false);
class IClient extends InternalClient { class IClient extends InternalClient {
IClient(Client transportClient){ IClient(Client transportClient){
super(Settings.EMPTY, null, transportClient); super(Settings.EMPTY, threadPool, transportClient);
} }
@Override @Override
protected <Request extends ActionRequest, Response extends ActionResponse, RequestBuilder extends protected <Request extends ActionRequest, Response extends ActionResponse, RequestBuilder extends
ActionRequestBuilder<Request, Response, RequestBuilder>> void doExecute( ActionRequestBuilder<Request, Response, RequestBuilder>> void doExecute(