From 7c02995a1df09e2c72b85718b0495bd7416cf40c Mon Sep 17 00:00:00 2001 From: "saul.gill" Date: Thu, 26 Oct 2023 14:59:37 +0100 Subject: Fix participant test Issue-ID: POLICY-4858 Change-Id: I2c4c22d5058177b0bf8727630a4f524b0c039b13 Signed-off-by: saul.gill --- .../clamp/acm/runtime/participant/ParticipantControllerTest.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'runtime-acm/src/test/java/org/onap') 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 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 -- cgit 1.2.3-korg