Skip to content

Commit

Permalink
merge cases with the same body
Browse files Browse the repository at this point in the history
  • Loading branch information
idegtiarenko committed Oct 26, 2023
1 parent 6bc84bd commit a625fe9
Showing 1 changed file with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -378,10 +378,11 @@ public void testSearchTaskDescriptions() {
assertEquals(mainTask.get(0).taskId(), taskInfo.parentTaskId());
assertTaskHeaders(taskInfo);
switch (taskInfo.action()) {
case SearchTransportService.QUERY_ACTION_NAME, SearchTransportService.DFS_ACTION_NAME -> assertTrue(
taskInfo.description(),
Regex.simpleMatch("shardId[[test][*]]", taskInfo.description())
);
case SearchTransportService.QUERY_ACTION_NAME, SearchTransportService.QUERY_CAN_MATCH_NAME,
SearchTransportService.DFS_ACTION_NAME -> assertTrue(
taskInfo.description(),
Regex.simpleMatch("shardId[[test][*]]", taskInfo.description())
);
case SearchTransportService.QUERY_ID_ACTION_NAME -> assertTrue(
taskInfo.description(),
Regex.simpleMatch("id[*], indices[test]", taskInfo.description())
Expand All @@ -390,10 +391,6 @@ public void testSearchTaskDescriptions() {
taskInfo.description(),
Regex.simpleMatch("id[*], size[1], lastEmittedDoc[null]", taskInfo.description())
);
case SearchTransportService.QUERY_CAN_MATCH_NAME -> assertTrue(
taskInfo.description(),
Regex.simpleMatch("shardId[[test][*]]", taskInfo.description())
);
default -> fail("Unexpected action [" + taskInfo.action() + "] with description [" + taskInfo.description() + "]");
}
// assert that all task descriptions have non-zero length
Expand Down

0 comments on commit a625fe9

Please sign in to comment.