diff options
author | 2021-08-12 15:33:10 +0000 | |
---|---|---|
committer | 2021-08-12 15:33:10 +0000 | |
commit | a37bd982693785af5fc791df0baaa49dda039846 (patch) | |
tree | 3f230384fdce5ee3148b20bd8e794832a78d9073 /participant/participant-impl/participant-impl-policy/src | |
parent | 9796dd1e99aea6768a8ed9bf11557db0c2a9c210 (diff) | |
parent | 20e2a1787c703a7957728e0c9a190a556b0ae536 (diff) |
Merge "Fix serialization of messages in Control Loop and Participants"
Diffstat (limited to 'participant/participant-impl/participant-impl-policy/src')
2 files changed, 12 insertions, 15 deletions
diff --git a/participant/participant-impl/participant-impl-policy/src/test/java/org/onap/policy/clamp/controlloop/participant/policy/endtoend/ParticipantMessagesTest.java b/participant/participant-impl/participant-impl-policy/src/test/java/org/onap/policy/clamp/controlloop/participant/policy/endtoend/ParticipantMessagesTest.java index aed03556a..08e7154bb 100644 --- a/participant/participant-impl/participant-impl-policy/src/test/java/org/onap/policy/clamp/controlloop/participant/policy/endtoend/ParticipantMessagesTest.java +++ b/participant/participant-impl/participant-impl-policy/src/test/java/org/onap/policy/clamp/controlloop/participant/policy/endtoend/ParticipantMessagesTest.java @@ -156,12 +156,12 @@ class ParticipantMessagesTest { final ParticipantStatus heartbeat = new ParticipantStatus(); heartbeat.setParticipantId(getParticipantId()); ControlLoopInfo clInfo = getControlLoopInfo(getControlLoopId()); - heartbeat.setControlLoopInfoMap(Map.of(getControlLoopId(), clInfo)); + heartbeat.setControlLoopInfoMap(Map.of(getControlLoopId().toString(), clInfo)); ControlLoopElementDefinition clDefinition = getClElementDefinition(); Map<UUID, ControlLoopElementDefinition> clElementDefinitionMap = Map.of(UUID.randomUUID(), clDefinition); - Map<ToscaConceptIdentifier, Map<UUID, ControlLoopElementDefinition>> - participantDefinitionUpdateMap = Map.of(getParticipantId(), clElementDefinitionMap); + Map<String, Map<UUID, ControlLoopElementDefinition>> + participantDefinitionUpdateMap = Map.of(getParticipantId().toString(), clElementDefinitionMap); heartbeat.setParticipantDefinitionUpdateMap(participantDefinitionUpdateMap); synchronized (lockit) { diff --git a/participant/participant-impl/participant-impl-policy/src/test/java/org/onap/policy/clamp/controlloop/participant/policy/main/utils/TestListenerUtils.java b/participant/participant-impl/participant-impl-policy/src/test/java/org/onap/policy/clamp/controlloop/participant/policy/main/utils/TestListenerUtils.java index b91cff22c..f87714e0e 100644 --- a/participant/participant-impl/participant-impl-policy/src/test/java/org/onap/policy/clamp/controlloop/participant/policy/main/utils/TestListenerUtils.java +++ b/participant/participant-impl/participant-impl-policy/src/test/java/org/onap/policy/clamp/controlloop/participant/policy/main/utils/TestListenerUtils.java @@ -34,7 +34,6 @@ import org.onap.policy.clamp.controlloop.models.controlloop.concepts.ControlLoop import org.onap.policy.clamp.controlloop.models.controlloop.concepts.ControlLoopElementDefinition; import org.onap.policy.clamp.controlloop.models.controlloop.concepts.ControlLoopOrderedState; import org.onap.policy.clamp.controlloop.models.controlloop.concepts.ControlLoopState; -import org.onap.policy.clamp.controlloop.models.controlloop.concepts.ParticipantState; import org.onap.policy.clamp.controlloop.models.messages.dmaap.participant.ControlLoopStateChange; import org.onap.policy.clamp.controlloop.models.messages.dmaap.participant.ControlLoopUpdate; import org.onap.policy.clamp.controlloop.models.messages.dmaap.participant.ParticipantUpdate; @@ -181,7 +180,7 @@ public class TestListenerUtils { final ParticipantUpdate participantUpdateMsg = new ParticipantUpdate(); ToscaConceptIdentifier participantId = new ToscaConceptIdentifier("org.onap.PM_Policy", "1.0.0"); ToscaConceptIdentifier participantType = new ToscaConceptIdentifier( - "org.onap.policy.controlloop.PolicyControlLoopParticipant", "2.3.1"); + "org.onap.policy.controlloop.PolicyControlLoopParticipant", "2.3.1"); participantUpdateMsg.setParticipantId(participantId); participantUpdateMsg.setTimestamp(Instant.now()); @@ -200,10 +199,10 @@ public class TestListenerUtils { clDefinition.setCommonPropertiesMap(commonPropertiesMap); Map<UUID, ControlLoopElementDefinition> controlLoopElementDefinitionMap = - Map.of(UUID.randomUUID(), clDefinition); + Map.of(UUID.randomUUID(), clDefinition); - Map<ToscaConceptIdentifier, Map<UUID, ControlLoopElementDefinition>> - participantDefinitionUpdateMap = Map.of(participantId, controlLoopElementDefinitionMap); + Map<String, Map<UUID, ControlLoopElementDefinition>> participantDefinitionUpdateMap = + Map.of(participantId.toString(), controlLoopElementDefinitionMap); participantUpdateMsg.setParticipantDefinitionUpdateMap(participantDefinitionUpdateMap); return participantUpdateMsg; @@ -217,10 +216,8 @@ public class TestListenerUtils { * @return ControlLoopUpdate message * @throws CoderException exception while reading the file to object */ - public static ControlLoopUpdate createParticipantClUpdateMsgFromJson(String jsonFilePath) - throws CoderException { - ControlLoopUpdate controlLoopUpdateMsg = - CODER.decode(new File(jsonFilePath), ControlLoopUpdate.class); + public static ControlLoopUpdate createParticipantClUpdateMsgFromJson(String jsonFilePath) throws CoderException { + ControlLoopUpdate controlLoopUpdateMsg = CODER.decode(new File(jsonFilePath), ControlLoopUpdate.class); return controlLoopUpdateMsg; } @@ -254,7 +251,7 @@ public class TestListenerUtils { String policyTypeString = ResourceUtils.getResourceAsString(policyTypeFilePath); ToscaServiceTemplate foundPolicyTypeSt = - yamlTranslator.fromYaml(policyTypeString, ToscaServiceTemplate.class); + yamlTranslator.fromYaml(policyTypeString, ToscaServiceTemplate.class); toscaServiceTemplate.setDerivedFrom(foundPolicyTypeSt.getDerivedFrom()); toscaServiceTemplate.setDescription(foundPolicyTypeSt.getDescription()); @@ -291,7 +288,7 @@ public class TestListenerUtils { String policiesString = ResourceUtils.getResourceAsString(policiesFilePath); ToscaServiceTemplate foundPoliciesSt = - yamlTranslator.fromYaml(policiesString, ToscaServiceTemplate.class); + yamlTranslator.fromYaml(policiesString, ToscaServiceTemplate.class); toscaServiceTemplate.getToscaTopologyTemplate().setPolicies( foundPoliciesSt.getToscaTopologyTemplate().getPolicies()); } @@ -305,7 +302,7 @@ public class TestListenerUtils { } ToscaServiceTemplate serviceTemplate = yamlTranslator.fromYaml( - controlLoopString, ToscaServiceTemplate.class); + controlLoopString, ToscaServiceTemplate.class); return serviceTemplate; } catch (FileNotFoundException e) { LOGGER.error("cannot find YAML file", controlLoopFilePath); |