This is the codeAbility Sharing Platform! Learn more about the codeAbility Sharing Platform.

Skip to content
Snippets Groups Projects

Resolve ""Error: Exercise could not be found..." during resource loading"

@@ -59,6 +59,7 @@ public class AuditEventServiceIT {
private int currentAuditLogs;
@BeforeEach
@Timeout(value = 5, unit = TimeUnit.MINUTES)
public void init() {
currentAuditLogs = persistenceAuditEventRepository.findAll().size();
log.info("There where already {} AuditEvents", currentAuditLogs);
@@ -118,9 +119,11 @@ public class AuditEventServiceIT {
log.info("Saved {} outdated AuditEvents", MAX_OUTDATEDVALUES);
assertThat(persistenceAuditEventRepository.findAll().size()).isGreaterThan(MAX_OUTDATEDVALUES);
log.info("Removing outdated AuditEvents");
auditEventService.removeOldAuditEvents();
// persistenceAuditEventRepository.flush();
log.info("Removed outdated AuditEvents");
assertThat(persistenceAuditEventRepository.findAll().size()).isEqualTo(currentAuditLogs + 2);
assertThat(persistenceAuditEventRepository.findByPrincipal("test-user-old")).isEmpty();
assertThat(persistenceAuditEventRepository.findByPrincipal("test-user-retention")).isNotEmpty();