Fix participant test 28/136328/1
authorsaul.gill <saul.gill@est.tech>
Thu, 26 Oct 2023 13:59:37 +0000 (14:59 +0100)
committersaul.gill <saul.gill@est.tech>
Thu, 26 Oct 2023 13:59:41 +0000 (14:59 +0100)
Issue-ID: POLICY-4858
Change-Id: I2c4c22d5058177b0bf8727630a4f524b0c039b13
Signed-off-by: saul.gill <saul.gill@est.tech>
runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/participant/ParticipantControllerTest.java

index a90773b..f8443de 100755 (executable)
@@ -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