Skip to content

Commit

Permalink
Updated audit replay test to use concurrent deque to avoid intermitte…
Browse files Browse the repository at this point in the history
…nt test failures.
  • Loading branch information
jwomeara committed May 10, 2023
1 parent 382c9b9 commit d319146
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentLinkedDeque;
import java.util.concurrent.TimeUnit;

import static datawave.security.authorization.DatawaveUser.UserType.USER;
Expand Down Expand Up @@ -90,7 +90,7 @@ public class AuditReplayTest {
private JWTRestTemplate jwtRestTemplate;

@Autowired
public LinkedList<AuditMessage> auditMessages;
public ConcurrentLinkedDeque<AuditMessage> auditMessages;

@Autowired
private AuditProperties auditProperties;
Expand Down Expand Up @@ -458,7 +458,7 @@ public void singleAuditReplayIgnoreUnfinishedTest() throws Exception {
received);
// @formatter:on

received = auditMessages.remove(0).getAuditParameters();
received = auditMessages.removeFirst().getAuditParameters();

// @formatter:off
assertAuditMessage(
Expand Down Expand Up @@ -2771,13 +2771,13 @@ public boolean isHealthy() {
}

@Bean
public LinkedList<AuditMessage> auditMessages() {
return new LinkedList<>();
public ConcurrentLinkedDeque<AuditMessage> auditMessages() {
return new ConcurrentLinkedDeque<>();
}

@Primary
@Bean
public AuditMessageSupplier testAuditSource(LinkedList<AuditMessage> auditMessages) {
public AuditMessageSupplier testAuditSource(ConcurrentLinkedDeque<AuditMessage> auditMessages) {
return new AuditMessageSupplier() {
@Override
public boolean send(Message<AuditMessage> auditMessage) {
Expand Down

0 comments on commit d319146

Please sign in to comment.