From d0a1bcee60c43a736a0526d49c07c564632c4f02 Mon Sep 17 00:00:00 2001 From: Sirisha_Manchikanti Date: Tue, 10 Aug 2021 21:51:48 +0100 Subject: Updated ControlLoop component messages Updated controlloop messages (ParticipantUpdate, ControlLoopUpdate, ParticipantStatus) according to the following Wiki and added implementation for the corresponding updates in runtime-controlloop and participant components https://wiki.onap.org/display/DW/The+CLAMP+Control+Loop+Participant+Protocol Issue-ID: POLICY-3417 Signed-off-by: Sirisha_Manchikanti Change-Id: I80d96a7553a89ca47de2aa35e09df5a5c792acfa --- .../src/test/java/handler/ClElementHandlerTest.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'participant/participant-impl/participant-impl-http/src/test') diff --git a/participant/participant-impl/participant-impl-http/src/test/java/handler/ClElementHandlerTest.java b/participant/participant-impl/participant-impl-http/src/test/java/handler/ClElementHandlerTest.java index 10b8103cb..46ed355de 100644 --- a/participant/participant-impl/participant-impl-http/src/test/java/handler/ClElementHandlerTest.java +++ b/participant/participant-impl/participant-impl-http/src/test/java/handler/ClElementHandlerTest.java @@ -24,6 +24,7 @@ import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.doNothing; +import java.util.Map; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -32,6 +33,7 @@ import org.mockito.Spy; import org.onap.policy.clamp.controlloop.models.controlloop.concepts.ControlLoopElement; import org.onap.policy.clamp.controlloop.participant.http.main.handler.ControlLoopElementHandler; import org.onap.policy.common.utils.coder.CoderException; +import org.onap.policy.models.tosca.authorative.concepts.ToscaNodeTemplate; import org.onap.policy.models.tosca.authorative.concepts.ToscaServiceTemplate; import org.springframework.test.context.junit.jupiter.SpringExtension; import utils.CommonTestData; @@ -47,6 +49,8 @@ class ClElementHandlerTest { private CommonTestData commonTestData = new CommonTestData(); private static ToscaServiceTemplate serviceTemplate; + private static final String HTTP_CONTROL_LOOP_ELEMENT = + "org.onap.domain.database.Http_PMSHMicroserviceControlLoopElement"; @BeforeAll static void init() throws CoderException { @@ -57,7 +61,11 @@ class ClElementHandlerTest { void test_ControlLoopElementUpdate() { doNothing().when(controlLoopElementHandler).invokeHttpClient(any()); ControlLoopElement element = commonTestData.getControlLoopElement(); + + Map nodeTemplatesMap = + serviceTemplate.getToscaTopologyTemplate().getNodeTemplates(); + assertDoesNotThrow(() -> controlLoopElementHandler - .controlLoopElementUpdate(element, serviceTemplate)); + .controlLoopElementUpdate(element, nodeTemplatesMap.get(HTTP_CONTROL_LOOP_ELEMENT))); } } -- cgit 1.2.3-korg