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

Skip to content
Snippets Groups Projects
Commit 225186a3 authored by Michael Breu's avatar Michael Breu
Browse files

prettier

parent 15ef3861
Branches
1 merge request!266merge development into master
......@@ -5,13 +5,11 @@ import static org.assertj.core.api.Assertions.assertThat;
import at.ac.uibk.gitsearch.GitsearchApp;
import at.ac.uibk.gitsearch.domain.PersistentAuditEvent;
import at.ac.uibk.gitsearch.repository.jpa.PersistenceAuditEventRepository;
import java.time.Instant;
import java.time.temporal.ChronoUnit;
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;
......@@ -27,7 +25,6 @@ import org.springframework.transaction.TransactionStatus;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.support.TransactionCallback;
import org.springframework.transaction.support.TransactionTemplate;
import tech.jhipster.config.JHipsterProperties;
/**
......@@ -60,17 +57,18 @@ public class AuditEventServiceIT {
private static final int MAX_OUTDATEDVALUES = 4500;
private int currentAuditLogs;
@BeforeEach
public void init() {
currentAuditLogs = persistenceAuditEventRepository.findAll().size();
log.info("There where already {} AuditEvents", currentAuditLogs);
final List<PersistentAuditEvent> auditEventDeleteCandidates = persistenceAuditEventRepository
.findTop1000ByAuditEventDateBefore(
Instant.now().minus(jHipsterProperties.getAuditEvents().getRetentionPeriod(), ChronoUnit.DAYS));
Assert.assertTrue("There are already outdated Elements?", auditEventDeleteCandidates.size() == 0);
log.info("Preparing {} outdated AuditEvents", MAX_OUTDATEDVALUES);
auditEventsOld = new ArrayList<>();
currentAuditLogs = persistenceAuditEventRepository.findAll().size();
log.info("There where already {} AuditEvents", currentAuditLogs);
final List<PersistentAuditEvent> auditEventDeleteCandidates = persistenceAuditEventRepository.findTop1000ByAuditEventDateBefore(
Instant.now().minus(jHipsterProperties.getAuditEvents().getRetentionPeriod(), ChronoUnit.DAYS)
);
Assert.assertTrue("There are already outdated Elements?", auditEventDeleteCandidates.size() == 0);
log.info("Preparing {} outdated AuditEvents", MAX_OUTDATEDVALUES);
auditEventsOld = new ArrayList<>();
for (int i = 1; i <= MAX_OUTDATEDVALUES; i++) {
PersistentAuditEvent auditEventOld = new PersistentAuditEvent();
auditEventOld.setAuditEventDate(
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment