diff options
Diffstat (limited to 'runtime-acm/src/test')
-rw-r--r-- | runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/instantiation/InstantiationUtils.java | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/instantiation/InstantiationUtils.java b/runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/instantiation/InstantiationUtils.java index 38c63fa9b..8639dffcd 100644 --- a/runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/instantiation/InstantiationUtils.java +++ b/runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/instantiation/InstantiationUtils.java @@ -25,6 +25,8 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.fail; import java.io.File; +import java.util.ArrayList; +import java.util.UUID; import org.onap.policy.clamp.models.acm.concepts.AutomationComposition; import org.onap.policy.clamp.models.acm.messages.rest.instantiation.InstantiationResponse; import org.onap.policy.common.utils.coder.Coder; @@ -56,6 +58,13 @@ public class InstantiationUtils { // add suffix to name automationComposition.setName(automationComposition.getName() + suffix); + var elements = new ArrayList<>(automationComposition.getElements().values()); + automationComposition.getElements().clear(); + for (var element : elements) { + // set unique UUID to the element + element.setId(UUID.randomUUID()); + automationComposition.getElements().put(element.getId(), element); + } return automationComposition; } catch (CoderException e) { fail("Cannot read or decode " + path); @@ -84,18 +93,6 @@ public class InstantiationUtils { } /** - * Assert that Instantiation Response contains proper AutomationCompositions. - * - * @param response InstantiationResponse - * @param affectedAutomationComposition ToscaConceptIdentifier - */ - public static void assertInstantiationResponse(InstantiationResponse response, - ToscaConceptIdentifier affectedAutomationComposition) { - assertThat(response).isNotNull(); - assertEquals(response.getAffectedAutomationComposition(), affectedAutomationComposition); - } - - /** * Assert that Instantiation Response contains AutomationComposition equals to automationComposition. * * @param response InstantiationResponse |