aboutsummaryrefslogtreecommitdiffstats
path: root/runtime-acm/src
diff options
context:
space:
mode:
authorFrancescoFioraEst <francesco.fiora@est.tech>2023-01-17 09:56:52 +0000
committerFrancescoFioraEst <francesco.fiora@est.tech>2023-01-23 15:22:35 +0000
commitc5e57c1b1cd0e778ebf47edd20fd9a340471ab72 (patch)
treef567d2bc52cf070bcccb83bad0f4ab5f70d2415f /runtime-acm/src
parenta263a250f7185fd9ddc4b600d96452fdbf21fffb (diff)
Refactor participantId as UUID
As part of endpoint refactoring, refactor participantId as UUID in ACM. Issue-ID: POLICY-4521 Change-Id: I8ac652d9b2fadf9ce3220febb9c2c3ac0d3786cc Signed-off-by: FrancescoFioraEst <francesco.fiora@est.tech>
Diffstat (limited to 'runtime-acm/src')
-rw-r--r--runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/instantiation/AutomationCompositionInstantiationProvider.java2
-rw-r--r--runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/participants/AcmParticipantProvider.java23
-rw-r--r--runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/SupervisionParticipantHandler.java4
-rw-r--r--runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/SupervisionScanner.java7
-rw-r--r--runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/comm/ParticipantRegisterAckPublisher.java2
-rw-r--r--runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/comm/ParticipantStatusReqPublisher.java4
-rw-r--r--runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/comm/ParticipantUpdatePublisher.java4
-rw-r--r--runtime-acm/src/main/resources/openapi/examples/getAllCompositionInstancesResponse.json15
-rw-r--r--runtime-acm/src/main/resources/openapi/examples/getAllCompositionInstancesResponse.yaml12
-rw-r--r--runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/supervision/SupervisionHandlerTest.java3
-rw-r--r--runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/supervision/SupervisionScannerTest.java7
-rw-r--r--runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/util/CommonTestData.java17
-rw-r--r--runtime-acm/src/test/resources/rest/acm/AutomationComposition.json15
-rw-r--r--runtime-acm/src/test/resources/rest/acm/AutomationCompositionElementsNotFound.json5
-rw-r--r--runtime-acm/src/test/resources/rest/acm/AutomationCompositionSmoke.json15
-rw-r--r--runtime-acm/src/test/resources/rest/acm/AutomationCompositionUpdate.json15
16 files changed, 47 insertions, 103 deletions
diff --git a/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/instantiation/AutomationCompositionInstantiationProvider.java b/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/instantiation/AutomationCompositionInstantiationProvider.java
index 099c0e740..53288d15e 100644
--- a/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/instantiation/AutomationCompositionInstantiationProvider.java
+++ b/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/instantiation/AutomationCompositionInstantiationProvider.java
@@ -243,7 +243,7 @@ public class AutomationCompositionInstantiationProvider {
var result = new BeanValidationResult("AutomationComposition", automationComposition);
var participantMap = participants.stream()
- .collect(Collectors.toMap(participant -> participant.getKey().asIdentifier(), Function.identity()));
+ .collect(Collectors.toMap(participant -> participant.getParticipantId(), Function.identity()));
for (var element : automationComposition.getElements().values()) {
diff --git a/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/participants/AcmParticipantProvider.java b/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/participants/AcmParticipantProvider.java
index 617f75668..18a8e8a26 100644
--- a/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/participants/AcmParticipantProvider.java
+++ b/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/participants/AcmParticipantProvider.java
@@ -23,12 +23,11 @@ package org.onap.policy.clamp.acm.runtime.participants;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
+import lombok.RequiredArgsConstructor;
import org.onap.policy.clamp.acm.runtime.supervision.comm.ParticipantStatusReqPublisher;
-import org.onap.policy.clamp.models.acm.concepts.Participant;
import org.onap.policy.clamp.models.acm.concepts.ParticipantInformation;
import org.onap.policy.clamp.models.acm.concepts.ParticipantState;
import org.onap.policy.clamp.models.acm.persistence.provider.ParticipantProvider;
-import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
@@ -36,25 +35,20 @@ import org.springframework.transaction.annotation.Transactional;
@Service
@Transactional
+@RequiredArgsConstructor
public class AcmParticipantProvider {
private static final Logger LOGGER = LoggerFactory.getLogger(AcmParticipantProvider.class);
private final ParticipantProvider participantProvider;
private final ParticipantStatusReqPublisher participantStatusReqPublisher;
- public AcmParticipantProvider(ParticipantProvider participantProvider,
- ParticipantStatusReqPublisher participantStatusReqPublisher) {
- this.participantProvider = participantProvider;
- this.participantStatusReqPublisher = participantStatusReqPublisher;
- }
-
/**
* Get all participants.
*
* @return A list of available participants
*/
public List<ParticipantInformation> getAllParticipants() {
- List<Participant> participants = this.participantProvider.getParticipants();
+ var participants = this.participantProvider.getParticipants();
List<ParticipantInformation> participantInformationList = new ArrayList<>();
participants.forEach(participant -> {
@@ -72,8 +66,8 @@ public class AcmParticipantProvider {
* @return The participant
*/
public ParticipantInformation getParticipantById(UUID participantId) {
- Participant participant = this.participantProvider.getParticipantById(participantId);
- ParticipantInformation participantInformation = new ParticipantInformation();
+ var participant = this.participantProvider.getParticipantById(participantId);
+ var participantInformation = new ParticipantInformation();
participantInformation.setParticipant(participant);
return participantInformation;
}
@@ -84,11 +78,10 @@ public class AcmParticipantProvider {
* @param participantId The UUID of the participant to send request to
*/
public void sendParticipantStatusRequest(UUID participantId) {
- Participant participant = this.participantProvider.getParticipantById(participantId);
- ToscaConceptIdentifier id = participant.getKey().asIdentifier();
+ var participant = this.participantProvider.getParticipantById(participantId);
LOGGER.debug("Requesting Participant Status Now ParticipantStatusReq");
- participantStatusReqPublisher.send(id);
+ participantStatusReqPublisher.send(participantId);
participant.setParticipantState(ParticipantState.OFF_LINE);
participantProvider.updateParticipant(participant);
}
@@ -98,6 +91,6 @@ public class AcmParticipantProvider {
*
*/
public void sendAllParticipantStatusRequest() {
- this.participantStatusReqPublisher.send((ToscaConceptIdentifier) null);
+ this.participantStatusReqPublisher.send((UUID) null);
}
}
diff --git a/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/SupervisionParticipantHandler.java b/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/SupervisionParticipantHandler.java
index 6f0f5cc7b..f58543684 100644
--- a/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/SupervisionParticipantHandler.java
+++ b/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/SupervisionParticipantHandler.java
@@ -106,9 +106,7 @@ public class SupervisionParticipantHandler {
if (participantOpt.isEmpty()) {
ParticipantRegister registerMessage = (ParticipantRegister) participantMessage;
var participant = new Participant();
- participant.setName(registerMessage.getParticipantId().getName());
- participant.setVersion(registerMessage.getParticipantId().getVersion());
- participant.setDefinition(registerMessage.getParticipantId());
+ participant.setParticipantId(participantMessage.getParticipantId());
participant.setParticipantType(registerMessage.getParticipantType());
participant.setParticipantSupportedElementTypes(listToMap(registerMessage
.getParticipantSupportedElementType()));
diff --git a/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/SupervisionScanner.java b/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/SupervisionScanner.java
index f758c9893..0e5aab5e3 100644
--- a/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/SupervisionScanner.java
+++ b/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/SupervisionScanner.java
@@ -36,7 +36,6 @@ import org.onap.policy.clamp.models.acm.concepts.ParticipantUtils;
import org.onap.policy.clamp.models.acm.persistence.provider.AcDefinitionProvider;
import org.onap.policy.clamp.models.acm.persistence.provider.AutomationCompositionProvider;
import org.onap.policy.clamp.models.acm.persistence.provider.ParticipantProvider;
-import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
import org.onap.policy.models.tosca.authorative.concepts.ToscaServiceTemplate;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -50,7 +49,7 @@ public class SupervisionScanner {
private static final Logger LOGGER = LoggerFactory.getLogger(SupervisionScanner.class);
private final HandleCounter<UUID> automationCompositionCounter = new HandleCounter<>();
- private final HandleCounter<ToscaConceptIdentifier> participantStatusCounter = new HandleCounter<>();
+ private final HandleCounter<UUID> participantStatusCounter = new HandleCounter<>();
private final Map<UUID, Integer> phaseMap = new HashMap<>();
@@ -118,7 +117,7 @@ public class SupervisionScanner {
}
private void scanParticipantStatus(Participant participant) {
- var id = participant.getKey().asIdentifier();
+ var id = participant.getParticipantId();
if (participantStatusCounter.isFault(id)) {
LOGGER.debug("report Participant fault");
return;
@@ -135,7 +134,7 @@ public class SupervisionScanner {
/**
* handle participant Status message.
*/
- public void handleParticipantStatus(ToscaConceptIdentifier id) {
+ public void handleParticipantStatus(UUID id) {
participantStatusCounter.clear(id);
}
diff --git a/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/comm/ParticipantRegisterAckPublisher.java b/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/comm/ParticipantRegisterAckPublisher.java
index bd8f2b560..3cadff6ee 100644
--- a/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/comm/ParticipantRegisterAckPublisher.java
+++ b/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/comm/ParticipantRegisterAckPublisher.java
@@ -40,7 +40,7 @@ public class ParticipantRegisterAckPublisher extends AbstractParticipantAckPubli
* @param participantType the participant Type
*/
@Timed(value = "publisher.participant_register_ack", description = "PARTICIPANT_REGISTER_ACK messages published")
- public void send(UUID responseTo, ToscaConceptIdentifier participantId, ToscaConceptIdentifier participantType) {
+ public void send(UUID responseTo, UUID participantId, ToscaConceptIdentifier participantType) {
var message = new ParticipantRegisterAck();
message.setParticipantId(participantId);
message.setParticipantType(participantType);
diff --git a/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/comm/ParticipantStatusReqPublisher.java b/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/comm/ParticipantStatusReqPublisher.java
index d1f183ee8..db69cdaf8 100644
--- a/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/comm/ParticipantStatusReqPublisher.java
+++ b/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/comm/ParticipantStatusReqPublisher.java
@@ -22,8 +22,8 @@ package org.onap.policy.clamp.acm.runtime.supervision.comm;
import io.micrometer.core.annotation.Timed;
import java.time.Instant;
+import java.util.UUID;
import org.onap.policy.clamp.models.acm.messages.dmaap.participant.ParticipantStatusReq;
-import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
@@ -39,7 +39,7 @@ public class ParticipantStatusReqPublisher extends AbstractParticipantPublisher<
* @param participantId the participant Id
*/
@Timed(value = "publisher.participant_status_req", description = "PARTICIPANT_STATUS_REQ messages published")
- public void send(ToscaConceptIdentifier participantId) {
+ public void send(UUID participantId) {
ParticipantStatusReq message = new ParticipantStatusReq();
message.setParticipantId(participantId);
message.setTimestamp(Instant.now());
diff --git a/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/comm/ParticipantUpdatePublisher.java b/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/comm/ParticipantUpdatePublisher.java
index af9023815..504ddc28c 100644
--- a/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/comm/ParticipantUpdatePublisher.java
+++ b/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/comm/ParticipantUpdatePublisher.java
@@ -68,7 +68,7 @@ public class ParticipantUpdatePublisher extends AbstractParticipantPublisher<Par
* @param participantId the ParticipantId
*/
@Timed(value = "publisher.participant_update", description = "PARTICIPANT_UPDATE messages published")
- public void sendCommissioning(ToscaConceptIdentifier participantType, ToscaConceptIdentifier participantId) {
+ public void sendCommissioning(ToscaConceptIdentifier participantType, UUID participantId) {
var list = acDefinitionProvider.getAllAcDefinitions();
if (list.isEmpty()) {
LOGGER.warn("No tosca service template found, cannot send participantupdate");
@@ -88,7 +88,7 @@ public class ParticipantUpdatePublisher extends AbstractParticipantPublisher<Par
*/
@Timed(value = "publisher.participant_update", description = "PARTICIPANT_UPDATE messages published")
public void sendCommissioning(AutomationCompositionDefinition acmDefinition,
- ToscaConceptIdentifier participantType, ToscaConceptIdentifier participantId) {
+ ToscaConceptIdentifier participantType, UUID participantId) {
var message = new ParticipantUpdate();
message.setCompositionId(acmDefinition.getCompositionId());
message.setParticipantType(participantType);
diff --git a/runtime-acm/src/main/resources/openapi/examples/getAllCompositionInstancesResponse.json b/runtime-acm/src/main/resources/openapi/examples/getAllCompositionInstancesResponse.json
index 55b99b28c..a1d0a999d 100644
--- a/runtime-acm/src/main/resources/openapi/examples/getAllCompositionInstancesResponse.json
+++ b/runtime-acm/src/main/resources/openapi/examples/getAllCompositionInstancesResponse.json
@@ -15,10 +15,7 @@
"name": "org.onap.policy.clamp.acm.HttpParticipant",
"version": "2.3.4"
},
- "participantId": {
- "name": "HttpParticipant0",
- "version": "1.0.0"
- },
+ "participantId": "101c62b3-8918-41b9-a747-d21eb79c6c01",
"state": "UNINITIALISED",
"orderedState": "UNINITIALISED",
"description": "Sink Automation Composition Element for the Demo",
@@ -34,10 +31,7 @@
"name": "org.onap.policy.clamp.acm.HttpParticipant",
"version": "2.3.4"
},
- "participantId": {
- "name": "HttpParticipant0",
- "version": "1.0.0"
- },
+ "participantId": "101c62b3-8918-41b9-a747-d21eb79c6c01",
"state": "UNINITIALISED",
"orderedState": "UNINITIALISED",
"description": "Bridge Automation Composition Element for the Demo",
@@ -53,10 +47,7 @@
"name": "org.onap.policy.clamp.acm.HttpParticipant",
"version": "2.3.4"
},
- "participantId": {
- "name": "HttpParticipant0",
- "version": "1.0.0"
- },
+ "participantId": "101c62b3-8918-41b9-a747-d21eb79c6c01",
"state": "UNINITIALISED",
"orderedState": "UNINITIALISED",
"description": "Starter Automation Composition Element for the Demo",
diff --git a/runtime-acm/src/main/resources/openapi/examples/getAllCompositionInstancesResponse.yaml b/runtime-acm/src/main/resources/openapi/examples/getAllCompositionInstancesResponse.yaml
index 3fa6506ea..3b007fda6 100644
--- a/runtime-acm/src/main/resources/openapi/examples/getAllCompositionInstancesResponse.yaml
+++ b/runtime-acm/src/main/resources/openapi/examples/getAllCompositionInstancesResponse.yaml
@@ -11,9 +11,7 @@ automationCompositionList:
participantType:
name: org.onap.policy.clamp.acm.HttpParticipant
version: 2.3.4
- participantId:
- name: HttpParticipant0
- version: 1.0.0
+ participantId: 101c62b3-8918-41b9-a747-d21eb79c6c01
state: UNINITIALISED
orderedState: UNINITIALISED
description: Sink Automation Composition Element for the Demo
@@ -26,9 +24,7 @@ automationCompositionList:
participantType:
name: org.onap.policy.clamp.acm.HttpParticipant
version: 2.3.4
- participantId:
- name: HttpParticipant0
- version: 1.0.0
+ participantId: 101c62b3-8918-41b9-a747-d21eb79c6c01
state: UNINITIALISED
orderedState: UNINITIALISED
description: Bridge Automation Composition Element for the Demo
@@ -41,9 +37,7 @@ automationCompositionList:
participantType:
name: org.onap.policy.clamp.acm.HttpParticipant
version: 2.3.4
- participantId:
- name: HttpParticipant0
- version: 1.0.0
+ participantId: 101c62b3-8918-41b9-a747-d21eb79c6c01
state: UNINITIALISED
orderedState: UNINITIALISED
description: Starter Automation Composition Element for the Demo
diff --git a/runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/supervision/SupervisionHandlerTest.java b/runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/supervision/SupervisionHandlerTest.java
index 4516ccd97..1db95e4b5 100644
--- a/runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/supervision/SupervisionHandlerTest.java
+++ b/runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/supervision/SupervisionHandlerTest.java
@@ -20,6 +20,7 @@
package org.onap.policy.clamp.acm.runtime.supervision;
+import static org.assertj.core.api.Assertions.assertThatCode;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
@@ -257,7 +258,7 @@ class SupervisionHandlerTest {
mock(ParticipantUpdatePublisher.class), AutomationCompositionOrderedState.PASSIVE,
AutomationCompositionState.UNINITIALISED);
- handler.handleParticipantMessage(participantUpdateAckMessage);
+ assertThatCode(() -> handler.handleParticipantMessage(participantUpdateAckMessage)).doesNotThrowAnyException();
}
@Test
diff --git a/runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/supervision/SupervisionScannerTest.java b/runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/supervision/SupervisionScannerTest.java
index 93f15f64d..683dd539a 100644
--- a/runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/supervision/SupervisionScannerTest.java
+++ b/runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/supervision/SupervisionScannerTest.java
@@ -130,7 +130,7 @@ class SupervisionScannerTest {
automationCompositionStateChangePublisher, automationCompositionUpdatePublisher, participantProvider,
acRuntimeParameterGroup);
- supervisionScanner.handleParticipantStatus(participant.getKey().asIdentifier());
+ supervisionScanner.handleParticipantStatus(participant.getParticipantId());
supervisionScanner.run(true);
verify(automationCompositionProvider, times(0)).updateAutomationComposition(any(AutomationComposition.class));
}
@@ -182,7 +182,6 @@ class SupervisionScannerTest {
var participant = CommonTestData.createParticipant(PARTICIPANT_TYPE, CommonTestData.getParticipantId());
participant.setParticipantState(ParticipantState.OFF_LINE);
- participant.setDefinition(new ToscaConceptIdentifier("unknown", "0.0.0"));
var participantProvider = mock(ParticipantProvider.class);
when(participantProvider.getParticipants()).thenReturn(List.of(participant));
@@ -193,9 +192,9 @@ class SupervisionScannerTest {
automationCompositionStateChangePublisher, automationCompositionUpdatePublisher, participantProvider,
acRuntimeParameterGroup);
- supervisionScanner.handleParticipantStatus(participant.getKey().asIdentifier());
+ supervisionScanner.handleParticipantStatus(participant.getParticipantId());
supervisionScanner.run(true);
- verify(participantProvider, times(0)).updateParticipant(any());
+ verify(participantProvider, times(0)).saveParticipant(any());
supervisionScanner.run(true);
verify(participantProvider, times(1)).updateParticipant(any());
diff --git a/runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/util/CommonTestData.java b/runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/util/CommonTestData.java
index 195afdc5d..7d80228db 100644
--- a/runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/util/CommonTestData.java
+++ b/runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/util/CommonTestData.java
@@ -21,6 +21,7 @@
package org.onap.policy.clamp.acm.runtime.util;
import java.util.List;
+import java.util.UUID;
import javax.ws.rs.core.Response.Status;
import org.onap.policy.clamp.acm.runtime.main.parameters.AcRuntimeParameterGroup;
import org.onap.policy.clamp.common.acm.exception.AutomationCompositionRuntimeException;
@@ -76,13 +77,13 @@ public class CommonTestData {
public static List<Participant> createParticipants() {
var participant1 = createParticipant(
new ToscaConceptIdentifier("org.onap.policy.clamp.acm.KubernetesParticipant", "2.3.4"),
- new ToscaConceptIdentifier("K8sParticipant0", "1.0.0"));
+ UUID.fromString("101c62b3-8918-41b9-a747-d21eb79c6c02"));
var participant2 = createParticipant(
new ToscaConceptIdentifier("org.onap.policy.clamp.acm.HttpParticipant", "2.3.4"),
- new ToscaConceptIdentifier("HttpParticipant0", "1.0.0"));
+ UUID.fromString("101c62b3-8918-41b9-a747-d21eb79c6c01"));
var participant3 = createParticipant(
new ToscaConceptIdentifier("org.onap.policy.clamp.acm.PolicyParticipant", "2.3.1"),
- new ToscaConceptIdentifier("org.onap.PM_Policy", "1.0.0"));
+ UUID.fromString("101c62b3-8918-41b9-a747-d21eb79c6c03"));
return List.of(participant1, participant2, participant3);
}
@@ -94,16 +95,14 @@ public class CommonTestData {
* @return a new Participant
*/
public static Participant createParticipant(ToscaConceptIdentifier participantType,
- ToscaConceptIdentifier participantId) {
+ UUID participantId) {
var participant = new Participant();
- participant.setDefinition(participantId);
+ participant.setParticipantId(participantId);
participant.setParticipantType(participantType);
- participant.setName(participantId.getName());
- participant.setVersion(participantId.getVersion());
return participant;
}
- public static ToscaConceptIdentifier getParticipantId() {
- return new ToscaConceptIdentifier("org.onap.PM_Policy", "1.0.0");
+ public static UUID getParticipantId() {
+ return UUID.fromString("101c62b3-8918-41b9-a747-d21eb79c6c03");
}
}
diff --git a/runtime-acm/src/test/resources/rest/acm/AutomationComposition.json b/runtime-acm/src/test/resources/rest/acm/AutomationComposition.json
index a754de9d3..77078e6eb 100644
--- a/runtime-acm/src/test/resources/rest/acm/AutomationComposition.json
+++ b/runtime-acm/src/test/resources/rest/acm/AutomationComposition.json
@@ -12,10 +12,7 @@
"name": "org.onap.domain.database.PMSH_K8SMicroserviceAutomationCompositionElement",
"version": "1.2.3"
},
- "participantId": {
- "name": "K8sParticipant0",
- "version": "1.0.0"
- },
+ "participantId": "101c62b3-8918-41b9-a747-d21eb79c6c02",
"participantType": {
"name": "org.onap.policy.clamp.acm.KubernetesParticipant",
"version": "2.3.4"
@@ -30,10 +27,7 @@
"name": "org.onap.domain.database.Http_PMSHMicroserviceAutomationCompositionElement",
"version": "1.2.3"
},
- "participantId": {
- "name": "HttpParticipant0",
- "version": "1.0.0"
- },
+ "participantId": "101c62b3-8918-41b9-a747-d21eb79c6c01",
"participantType": {
"name": "org.onap.policy.clamp.acm.HttpParticipant",
"version": "2.3.4"
@@ -48,10 +42,7 @@
"name": "org.onap.domain.pmsh.PMSH_OperationalPolicyAutomationCompositionElement",
"version": "1.2.3"
},
- "participantId": {
- "name": "org.onap.PM_Policy",
- "version": "1.0.0"
- },
+ "participantId": "101c62b3-8918-41b9-a747-d21eb79c6c03",
"participantType": {
"name": "org.onap.policy.clamp.acm.PolicyParticipant",
"version": "2.3.1"
diff --git a/runtime-acm/src/test/resources/rest/acm/AutomationCompositionElementsNotFound.json b/runtime-acm/src/test/resources/rest/acm/AutomationCompositionElementsNotFound.json
index ccfd587a4..80facb29c 100644
--- a/runtime-acm/src/test/resources/rest/acm/AutomationCompositionElementsNotFound.json
+++ b/runtime-acm/src/test/resources/rest/acm/AutomationCompositionElementsNotFound.json
@@ -54,10 +54,7 @@
"name": "org.onap.domain.pmsh.PMSH_OperationalPolicyAutomationCompositionElement",
"version": "1.2.3"
},
- "participantId": {
- "name": "org.onap.PM_Policy",
- "version": "1.0.0"
- },
+ "participantId": "101c62b3-8918-41b9-a747-d21eb79c6c03",
"participantType": {
"name": "org.onap.policy.clamp.acm.PolicyParticipant",
"version": "2.3.1"
diff --git a/runtime-acm/src/test/resources/rest/acm/AutomationCompositionSmoke.json b/runtime-acm/src/test/resources/rest/acm/AutomationCompositionSmoke.json
index 0fe9671e2..e66f3f68d 100644
--- a/runtime-acm/src/test/resources/rest/acm/AutomationCompositionSmoke.json
+++ b/runtime-acm/src/test/resources/rest/acm/AutomationCompositionSmoke.json
@@ -12,10 +12,7 @@
"name": "org.onap.domain.database.Http_PMSHMicroserviceAutomationCompositionElement",
"version": "1.2.3"
},
- "participantId": {
- "name": "HttpParticipant0",
- "version": "1.0.0"
- },
+ "participantId": "101c62b3-8918-41b9-a747-d21eb79c6c01",
"participantType": {
"name": "org.onap.policy.clamp.acm.HttpParticipant",
"version": "2.3.4"
@@ -30,10 +27,7 @@
"name": "org.onap.domain.pmsh.PMSH_OperationalPolicyAutomationCompositionElement",
"version": "1.2.3"
},
- "participantId": {
- "name": "org.onap.PM_Policy",
- "version": "1.0.0"
- },
+ "participantId": "101c62b3-8918-41b9-a747-d21eb79c6c03",
"participantType": {
"name": "org.onap.policy.clamp.acm.PolicyParticipant",
"version": "2.3.1"
@@ -48,10 +42,7 @@
"name": "org.onap.domain.database.PMSH_K8SMicroserviceAutomationCompositionElement",
"version": "1.2.3"
},
- "participantId": {
- "name": "K8sParticipant0t",
- "version": "1.0.0"
- },
+ "participantId": "101c62b3-8918-41b9-a747-d21eb79c6c02",
"participantType": {
"name": "org.onap.policy.clamp.acm.KubernetesParticipant",
"version": "2.3.4"
diff --git a/runtime-acm/src/test/resources/rest/acm/AutomationCompositionUpdate.json b/runtime-acm/src/test/resources/rest/acm/AutomationCompositionUpdate.json
index 75dbed72a..d0372a342 100644
--- a/runtime-acm/src/test/resources/rest/acm/AutomationCompositionUpdate.json
+++ b/runtime-acm/src/test/resources/rest/acm/AutomationCompositionUpdate.json
@@ -12,10 +12,7 @@
"name": "org.onap.domain.database.PMSH_K8SMicroserviceAutomationCompositionElement",
"version": "1.2.3"
},
- "participantId": {
- "name": "K8sParticipant0",
- "version": "1.0.0"
- },
+ "participantId": "101c62b3-8918-41b9-a747-d21eb79c6c02",
"participantType": {
"name": "org.onap.policy.clamp.acm.KubernetesParticipant",
"version": "2.3.4"
@@ -30,10 +27,7 @@
"name": "org.onap.domain.database.Http_PMSHMicroserviceAutomationCompositionElement",
"version": "1.2.3"
},
- "participantId": {
- "name": "HttpParticipant0",
- "version": "1.0.0"
- },
+ "participantId": "101c62b3-8918-41b9-a747-d21eb79c6c01",
"participantType": {
"name": "org.onap.policy.clamp.acm.HttpParticipant",
"version": "2.3.4"
@@ -48,10 +42,7 @@
"name": "org.onap.domain.pmsh.PMSH_OperationalPolicyAutomationCompositionElement",
"version": "1.2.3"
},
- "participantId": {
- "name": "org.onap.PM_Policy",
- "version": "1.0.0"
- },
+ "participantId": "101c62b3-8918-41b9-a747-d21eb79c6c03",
"participantType": {
"name": "org.onap.policy.clamp.acm.PolicyParticipant",
"version": "2.3.1"