Skip to content

Commit

Permalink
Increasing test coverage
Browse files Browse the repository at this point in the history
Signed-off-by: Joshua Palis <[email protected]>
  • Loading branch information
joshpalis committed Aug 16, 2024
1 parent d817902 commit 558e374
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@ public void testUpdateIndexStepWithUpdatedSettings() throws ExecutionException,
return null;
}).when(indicesAdminClient).getSettings(any(), any());

doAnswer(invocation -> {
ActionListener<AcknowledgedResponse> ackResponseListener = invocation.getArgument(1);
ackResponseListener.onResponse(new AcknowledgedResponse(true));
return null;
}).when(indicesAdminClient).updateSettings(any(), any());

// validate update settings request content
@SuppressWarnings({ "unchecked" })
ArgumentCaptor<UpdateSettingsRequest> updateSettingsRequestCaptor = ArgumentCaptor.forClass(UpdateSettingsRequest.class);
Expand Down Expand Up @@ -106,6 +112,12 @@ public void testUpdateIndexStepWithUpdatedSettings() throws ExecutionException,
assertEquals(2, settingsToUpdate.size());
assertEquals("_none", settingsToUpdate.get("index.default_pipeline"));
assertEquals("_none", settingsToUpdate.get("index.search.default_pipeline"));

assertTrue(future.isDone());
WorkflowData returnedData = (WorkflowData) future.get();
assertEquals(Map.ofEntries(Map.entry(INDEX_NAME, indexName)), returnedData.getContent());
assertEquals(data.getWorkflowId(), returnedData.getWorkflowId());
assertEquals(data.getNodeId(), returnedData.getNodeId());
}

public void testFailedToUpdateIndexSettings() throws ExecutionException, InterruptedException, IOException {
Expand Down

0 comments on commit 558e374

Please sign in to comment.