Fix compilation for CreateIndexResponse
The constructor for CreateIndexResponse changed to include the index name. This commit adapts x-pack-elasticsearch to this change. Original commit: elastic/x-pack-elasticsearch@b078d80cd9
This commit is contained in:
parent
c356074606
commit
cb62d81bdc
|
@ -85,7 +85,7 @@ public class JobProviderTests extends ESTestCase {
|
|||
|
||||
MockClientBuilder clientBuilder = new MockClientBuilder(CLUSTER_NAME);
|
||||
ArgumentCaptor<CreateIndexRequest> captor = ArgumentCaptor.forClass(CreateIndexRequest.class);
|
||||
clientBuilder.createIndexRequest(captor);
|
||||
clientBuilder.createIndexRequest(captor, resultsIndexName);
|
||||
clientBuilder.prepareAlias(resultsIndexName, AnomalyDetectorsIndex.jobResultsAliasedName("foo"), jobFilter);
|
||||
clientBuilder.prepareAlias(resultsIndexName, AnomalyDetectorsIndex.resultsWriteAlias("foo"));
|
||||
|
||||
|
@ -196,7 +196,7 @@ public class JobProviderTests extends ESTestCase {
|
|||
|
||||
MockClientBuilder clientBuilder = new MockClientBuilder(CLUSTER_NAME);
|
||||
ArgumentCaptor<CreateIndexRequest> captor = ArgumentCaptor.forClass(CreateIndexRequest.class);
|
||||
clientBuilder.createIndexRequest(captor);
|
||||
clientBuilder.createIndexRequest(captor, indexName);
|
||||
clientBuilder.prepareAlias(indexName, readAliasName, jobFilter);
|
||||
clientBuilder.prepareAlias(indexName, writeAliasName);
|
||||
clientBuilder.preparePutMapping(mock(PutMappingResponse.class), Result.TYPE.getPreferredName());
|
||||
|
|
|
@ -173,10 +173,10 @@ public class MockClientBuilder {
|
|||
}
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
public MockClientBuilder createIndexRequest(ArgumentCaptor<CreateIndexRequest> requestCapture) {
|
||||
public MockClientBuilder createIndexRequest(ArgumentCaptor<CreateIndexRequest> requestCapture, final String index) {
|
||||
|
||||
doAnswer(invocation -> {
|
||||
CreateIndexResponse response = new CreateIndexResponse(true, true) {};
|
||||
CreateIndexResponse response = new CreateIndexResponse(true, true, index) {};
|
||||
((ActionListener) invocation.getArguments()[1]).onResponse(response);
|
||||
return null;
|
||||
}).when(indicesAdminClient).create(requestCapture.capture(), any(ActionListener.class));
|
||||
|
|
Loading…
Reference in New Issue