aboutsummaryrefslogtreecommitdiffstats
path: root/runtime-acm
diff options
context:
space:
mode:
authorsaul.gill <saul.gill@est.tech>2023-10-26 14:59:37 +0100
committersaul.gill <saul.gill@est.tech>2023-10-26 14:59:41 +0100
commit7c02995a1df09e2c72b85718b0495bd7416cf40c (patch)
treeaa7b0b78f5543062adf0543d669d42f81522522c /runtime-acm
parentbabdc373f453258794b29ab6f872d0c20b59d471 (diff)
Fix participant test
Issue-ID: POLICY-4858 Change-Id: I2c4c22d5058177b0bf8727630a4f524b0c039b13 Signed-off-by: saul.gill <saul.gill@est.tech>
Diffstat (limited to 'runtime-acm')
-rwxr-xr-xruntime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/participant/ParticipantControllerTest.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/participant/ParticipantControllerTest.java b/runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/participant/ParticipantControllerTest.java
index a90773b10..f8443de33 100755
--- a/runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/participant/ParticipantControllerTest.java
+++ b/runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/participant/ParticipantControllerTest.java
@@ -31,6 +31,7 @@ import jakarta.ws.rs.core.Response;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
+import java.util.stream.Collectors;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -128,7 +129,12 @@ class ParticipantControllerTest extends CommonRestController {
var response = invocationBuilder.buildGet().invoke();
assertEquals(Response.Status.OK.getStatusCode(), response.getStatus());
List<ParticipantInformation> entityList = response.readEntity(new GenericType<>() {});
- assertThat(entityList).hasSameSizeAs(inputParticipants);
+ assertThat(entityList).isNotEmpty();
+ var participantIds = entityList.stream().map(ParticipantInformation::getParticipant)
+ .map(Participant::getParticipantId).collect(Collectors.toSet());
+ inputParticipants.forEach(p -> {
+ assertThat(participantIds).contains(p.getParticipantId());
+ });
}
@Test