Skip to content

Commit cfcff7b

Browse files
committed
Fix based on feedback
1 parent 8efc158 commit cfcff7b

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

core/src/test/java/com/scalar/db/transaction/consensuscommit/ParallelExecutorTest.java

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -695,22 +695,24 @@ public void executeTasks_ParallelTrueAndStopOnErrorTrue_ExceptionThrown_ShouldSt
695695

696696
List<ParallelExecutorTask> mixedTasks = Arrays.asList(failingTask1, failingTask2, task);
697697

698-
// Act Assert
698+
// Act
699699
Exception exception =
700700
catchException(
701701
() ->
702702
parallelExecutor.executeTasks(
703703
mixedTasks, parallel, noWait, stopOnError, "test", TX_ID));
704704

705-
if (exception == executionException1) {
706-
assertThat(exception)
707-
.isEqualTo(executionException1)
708-
.hasSuppressedException(executionException2);
709-
} else {
710-
assertThat(exception)
711-
.isEqualTo(executionException2)
712-
.hasSuppressedException(executionException1);
713-
}
705+
// Assert
706+
assertThat(exception)
707+
.satisfiesAnyOf(
708+
e ->
709+
assertThat(e)
710+
.isEqualTo(executionException1)
711+
.hasSuppressedException(executionException2),
712+
e ->
713+
assertThat(e)
714+
.isEqualTo(executionException2)
715+
.hasSuppressedException(executionException1));
714716

715717
verify(parallelExecutorService, times(mixedTasks.size())).execute(any());
716718
}

0 commit comments

Comments
 (0)