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

Skip to content
Snippets Groups Projects

audit event failed tests

Merged Philipp Gritsch requested to merge audit-event-failed-test into development
Viewing commit f238d91b
Show latest version
1 file
+ 18
4
Compare changes
  • Side-by-side
  • Inline
@@ -11,9 +11,7 @@ import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;
import org.junit.Assert;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Timeout;
import org.junit.jupiter.api.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -96,7 +94,7 @@ public class AuditEventServiceIT {
}
@Test
// @Disabled // currently not working
@Disabled // currently not working
@Timeout(value = 5, unit = TimeUnit.MINUTES)
@DirtiesContext
public void verifyOldAuditEventsAreDeleted() {
@@ -143,6 +141,22 @@ public class AuditEventServiceIT {
public void verifyOldAuditEventsAreDeleted2() {
persistenceAuditEventRepository.deleteAll();
persistenceAuditEventRepository.saveAll(auditEventsOld);
Assertions.assertTrue(
auditEventsOld
.stream()
.map(PersistentAuditEvent::getAuditEventDate)
.allMatch(d -> d.isBefore(Instant.now().minus(jHipsterProperties.getAuditEvents().getRetentionPeriod(), ChronoUnit.DAYS)))
);
Assertions.assertTrue(
persistenceAuditEventRepository
.findAll()
.stream()
.map(PersistentAuditEvent::getAuditEventDate)
.allMatch(d -> d.isBefore(Instant.now().minus(jHipsterProperties.getAuditEvents().getRetentionPeriod(), ChronoUnit.DAYS)))
);
persistenceAuditEventRepository.save(auditEventWithinRetention);
persistenceAuditEventRepository.save(auditEventNew);