Skip to content

Commit 1d6c710

Browse files
committed
adjusted test
1 parent b2d9a58 commit 1d6c710

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

core/src/test/java/org/sterl/spring/persistent_tasks/history/HistoryServiceTest.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import java.util.Optional;
77
import java.util.concurrent.TimeoutException;
88

9+
import org.junit.jupiter.api.RepeatedTest;
910
import org.junit.jupiter.api.Test;
1011
import org.springframework.beans.factory.annotation.Autowired;
1112
import org.springframework.data.domain.PageRequest;
@@ -59,8 +60,8 @@ void testTriggerHistory() throws TimeoutException, InterruptedException {
5960
assertThat(triggers.get(2).getData().getStatus()).isEqualTo(TriggerStatus.WAITING);
6061
}
6162

62-
@Test
63-
void testTriggerHistoryTrx() throws TimeoutException, InterruptedException {
63+
@RepeatedTest(3)
64+
void testTriggerHistoryTrx() {
6465
// GIVEN
6566
final var trigger = Task3.ID.newUniqueTrigger("Hallo");
6667
persistentTaskService.queue(trigger);
@@ -71,9 +72,11 @@ void testTriggerHistoryTrx() throws TimeoutException, InterruptedException {
7172
});
7273

7374
// THEN
74-
// 2 to get the work
75+
// 2 to get the work done
7576
// 1 for the running history
7677
// 1 for the success history
7778
hibernateAsserts.assertTrxCount(4);
79+
assertThat(subject.countTriggers(trigger.key())).isEqualTo(1);
80+
assertThat(subject.findAllDetailsForKey(trigger.key()).getTotalElements()).isEqualTo(3);
7881
}
7982
}

0 commit comments

Comments
 (0)