This is the codeAbility Sharing Platform! Learn more about the
codeAbility Sharing Platform
.
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
codeAbility Sharing Platform
Manage
Activity
Members
Labels
Plan
Issues
41
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
development
sharing
codeAbility Sharing Platform
Commits
225186a3
Commit
225186a3
authored
9 months ago
by
Michael Breu
Browse files
Options
Downloads
Patches
Plain Diff
prettier
parent
15ef3861
Branches
Branches containing commit
1 merge request
!266
merge development into master
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/test/java/at/ac/uibk/gitsearch/service/AuditEventServiceIT.java
+10
-12
10 additions, 12 deletions
...ava/at/ac/uibk/gitsearch/service/AuditEventServiceIT.java
with
10 additions
and
12 deletions
src/test/java/at/ac/uibk/gitsearch/service/AuditEventServiceIT.java
+
10
−
12
View file @
225186a3
...
...
@@ -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
(
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment