Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,9 @@ void remove_GivenAllFullTxIds_ShouldRemoveAll() throws Exception {
}
}

@SuppressWarnings("ClassCanBeStatic")
@Nested
static class CoordinatorGroupCommitKeyManipulatorTest {
class CoordinatorGroupCommitKeyManipulatorTest {
private final CoordinatorGroupCommitKeyManipulator keyManipulator =
new CoordinatorGroupCommitKeyManipulator();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package com.scalar.db.transaction.consensuscommit;

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatCode;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.assertj.core.api.Assertions.catchException;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.atMost;
import static org.mockito.Mockito.doThrow;
Expand Down Expand Up @@ -693,13 +695,24 @@ public void executeTasks_ParallelTrueAndStopOnErrorTrue_ExceptionThrown_ShouldSt

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

// Act Assert
assertThatThrownBy(
// Act
Exception exception =
catchException(
() ->
parallelExecutor.executeTasks(
mixedTasks, parallel, noWait, stopOnError, "test", TX_ID))
.isEqualTo(executionException1)
.hasSuppressedException(executionException2);
mixedTasks, parallel, noWait, stopOnError, "test", TX_ID));

// Assert
assertThat(exception)
.satisfiesAnyOf(
e ->
assertThat(e)
.isEqualTo(executionException1)
.hasSuppressedException(executionException2),
e ->
assertThat(e)
.isEqualTo(executionException2)
.hasSuppressedException(executionException1));

verify(parallelExecutorService, times(mixedTasks.size())).execute(any());
}
Expand Down