From 9659c99c9c8b4b7ce33d7f48e61df44a03090186 Mon Sep 17 00:00:00 2001 From: "saul.gill" Date: Thu, 2 Feb 2023 11:40:29 +0000 Subject: Refactor ParticipantUpdate to ParticipantPrime Refactored ParticipantUpdateAck to ParticipantPrimeAck Refactored ParticipantUpdate to ParticipantPrime Refactored all associated tests and code Issue-ID: POLICY-4548 Change-Id: I2265777add4e088173ec465603e26143e3f40070 Signed-off-by: saul.gill --- .../intermediary/comm/ParticipantCommTest.java | 6 ++--- .../handler/ParticipantHandlerTest.java | 28 +++++++++++----------- 2 files changed, 17 insertions(+), 17 deletions(-) (limited to 'participant/participant-intermediary/src/test') diff --git a/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/comm/ParticipantCommTest.java b/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/comm/ParticipantCommTest.java index d9d99da4e..1540d6e4c 100644 --- a/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/comm/ParticipantCommTest.java +++ b/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/comm/ParticipantCommTest.java @@ -1,6 +1,6 @@ /*- * ============LICENSE_START======================================================= - * Copyright (C) 2021-2022 Nordix Foundation. + * Copyright (C) 2021-2023 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -56,8 +56,8 @@ class ParticipantCommTest { assertEquals(ParticipantMessageType.PARTICIPANT_DEREGISTER_ACK.name(), participantDeregisterAckListener.getType()); - var participantUpdateListener = new ParticipantUpdateListener(participantHandler); - assertEquals(ParticipantMessageType.PARTICIPANT_UPDATE.name(), participantUpdateListener.getType()); + var participantPrimeListener = new ParticipantPrimeListener(participantHandler); + assertEquals(ParticipantMessageType.PARTICIPANT_PRIME.name(), participantPrimeListener.getType()); var automationCompositionUpdateListener = new AutomationCompositionDeployListener(participantHandler); assertEquals(ParticipantMessageType.AUTOMATION_COMPOSITION_DEPLOY.name(), diff --git a/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/handler/ParticipantHandlerTest.java b/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/handler/ParticipantHandlerTest.java index 9f1bf29be..7349ab9c0 100644 --- a/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/handler/ParticipantHandlerTest.java +++ b/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/handler/ParticipantHandlerTest.java @@ -39,8 +39,8 @@ import org.onap.policy.clamp.models.acm.concepts.ParticipantDefinition; import org.onap.policy.clamp.models.acm.messages.dmaap.participant.ParticipantAckMessage; import org.onap.policy.clamp.models.acm.messages.dmaap.participant.ParticipantMessage; import org.onap.policy.clamp.models.acm.messages.dmaap.participant.ParticipantMessageType; +import org.onap.policy.clamp.models.acm.messages.dmaap.participant.ParticipantPrime; import org.onap.policy.clamp.models.acm.messages.dmaap.participant.ParticipantRegisterAck; -import org.onap.policy.clamp.models.acm.messages.dmaap.participant.ParticipantUpdate; import org.onap.policy.common.utils.coder.CoderException; class ParticipantHandlerTest { @@ -54,43 +54,43 @@ class ParticipantHandlerTest { var publisher = new ParticipantMessagePublisher(); var emptyParticipantHandler = new ParticipantHandler(parameters, publisher, automationCompositionHander); - var participantUpdateMsg = new ParticipantUpdate(); + var participantPrimeMsg = new ParticipantPrime(); assertThatThrownBy(() -> - emptyParticipantHandler.handleParticipantUpdate(participantUpdateMsg)) + emptyParticipantHandler.handleParticipantPrime(participantPrimeMsg)) .isInstanceOf(RuntimeException.class); var participantHandler = commonTestData.getMockParticipantHandler(); var participantId = CommonTestData.getParticipantId(); - participantUpdateMsg.setAutomationCompositionId(CommonTestData.AC_ID_1); - participantUpdateMsg.setCompositionId(CommonTestData.AC_ID_1); - participantUpdateMsg.setParticipantId(participantId); - participantUpdateMsg.setMessageId(UUID.randomUUID()); - participantUpdateMsg.setTimestamp(Instant.ofEpochMilli(3000)); + participantPrimeMsg.setAutomationCompositionId(CommonTestData.AC_ID_1); + participantPrimeMsg.setCompositionId(CommonTestData.AC_ID_1); + participantPrimeMsg.setParticipantId(participantId); + participantPrimeMsg.setMessageId(UUID.randomUUID()); + participantPrimeMsg.setTimestamp(Instant.ofEpochMilli(3000)); var heartbeatF = participantHandler.makeHeartbeat(false); assertEquals(participantId, heartbeatF.getParticipantId()); assertThat(heartbeatF.getAutomationCompositionInfoList()).isEmpty(); - participantHandler.handleParticipantUpdate(participantUpdateMsg); + participantHandler.handleParticipantPrime(participantPrimeMsg); var heartbeatT = participantHandler.makeHeartbeat(true); assertEquals(participantId, heartbeatT.getParticipantId()); assertThat(heartbeatT.getParticipantDefinitionUpdates()).isNotEmpty(); assertEquals(participantId, heartbeatT.getParticipantDefinitionUpdates().get(0).getParticipantId()); - var pum = setListParticipantDefinition(participantUpdateMsg); - participantHandler.handleParticipantUpdate(pum); + var pum = setListParticipantDefinition(participantPrimeMsg); + participantHandler.handleParticipantPrime(pum); var heartbeatTAfterUpdate = participantHandler.makeHeartbeat(true); assertEquals(participantId, heartbeatTAfterUpdate.getParticipantId()); } - private ParticipantUpdate setListParticipantDefinition(ParticipantUpdate participantUpdateMsg) { + private ParticipantPrime setListParticipantDefinition(ParticipantPrime participantPrimeMsg) { var def = new ParticipantDefinition(); def.setParticipantId(CommonTestData.getParticipantId()); - participantUpdateMsg.setParticipantDefinitionUpdates(List.of(def)); - return participantUpdateMsg; + participantPrimeMsg.setParticipantDefinitionUpdates(List.of(def)); + return participantPrimeMsg; } @Test -- cgit 1.2.3-korg