FINERACT-2396: Fix retry issue during persisting CommandSource

This commit is contained in:
Adam Saghy
2025-10-21 18:38:05 +02:00
parent a561264f81
commit d6354ee408
2 changed files with 10 additions and 4 deletions
@@ -591,5 +591,11 @@ public class SynchronousCommandProcessingServiceTest {
assertEquals(persistentException, exception.getCause());
assertTrue(saveAttempts.get() >= 3, "Expected at least 3 save attempts, but got: " + saveAttempts.get());
// First call was before saving CommandSource, then 2 calls during retry (1st retry does not try to fetch it)
verify(commandSourceService, times(3)).getCommandSource(commandId);
// Let test whether consecutive calls does not try to refetch immediately
when(commandSourceService.saveResultSameTransaction(any(CommandSource.class))).thenReturn(commandSource);
underTest.executeCommand(commandWrapper, jsonCommand, false);
verify(commandSourceService, times(4)).getCommandSource(commandId);
}
}