diff options
Diffstat (limited to 'runtime-acm')
4 files changed, 10 insertions, 10 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 374c94f5d..b723dba7f 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 @@ -201,10 +201,10 @@ public class AutomationCompositionInstantiationProvider { * @return the automation compositions */ @Transactional(readOnly = true) - public AutomationCompositions getAutomationCompositions(String name, String version) { + public AutomationCompositions getAutomationCompositions(UUID compositionId, String name, String version) { var automationCompositions = new AutomationCompositions(); - automationCompositions - .setAutomationCompositionList(automationCompositionProvider.getAutomationCompositions(name, version)); + automationCompositions.setAutomationCompositionList( + automationCompositionProvider.getAutomationCompositions(compositionId, name, version)); return automationCompositions; } diff --git a/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/main/rest/InstantiationController.java b/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/main/rest/InstantiationController.java index 92651bc91..e44fbc5ed 100644 --- a/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/main/rest/InstantiationController.java +++ b/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/main/rest/InstantiationController.java @@ -90,7 +90,7 @@ public class InstantiationController extends AbstractRestController implements A public ResponseEntity<AutomationCompositions> queryCompositionInstances(UUID compositionId, String name, String version, UUID requestId) { - return ResponseEntity.ok().body(provider.getAutomationCompositions(name, version)); + return ResponseEntity.ok().body(provider.getAutomationCompositions(compositionId, name, version)); } /** diff --git a/runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/instantiation/AutomationCompositionInstantiationProviderTest.java b/runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/instantiation/AutomationCompositionInstantiationProviderTest.java index 0657c7e0c..c14d64069 100644 --- a/runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/instantiation/AutomationCompositionInstantiationProviderTest.java +++ b/runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/instantiation/AutomationCompositionInstantiationProviderTest.java @@ -109,10 +109,10 @@ class AutomationCompositionInstantiationProviderTest { verify(acProvider).createAutomationComposition(automationCompositionCreate); - when(acProvider.getAutomationCompositions(automationCompositionCreate.getName(), + when(acProvider.getAutomationCompositions(compositionId, automationCompositionCreate.getName(), automationCompositionCreate.getVersion())).thenReturn(List.of(automationCompositionCreate)); - var automationCompositionsGet = instantiationProvider.getAutomationCompositions( + var automationCompositionsGet = instantiationProvider.getAutomationCompositions(compositionId, automationCompositionCreate.getName(), automationCompositionCreate.getVersion()); assertThat(automationCompositionCreate) .isEqualTo(automationCompositionsGet.getAutomationCompositionList().get(0)); diff --git a/runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/instantiation/rest/InstantiationControllerTest.java b/runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/instantiation/rest/InstantiationControllerTest.java index 0e58eb6ae..21d001d95 100644 --- a/runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/instantiation/rest/InstantiationControllerTest.java +++ b/runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/instantiation/rest/InstantiationControllerTest.java @@ -238,7 +238,7 @@ class InstantiationControllerTest extends CommonRestController { var instResponse = resp.readEntity(InstantiationResponse.class); InstantiationUtils.assertInstantiationResponse(instResponse, automationComposition); - var automationCompositionsFromDb = instantiationProvider.getAutomationCompositions( + var automationCompositionsFromDb = instantiationProvider.getAutomationCompositions(compositionId, automationComposition.getKey().getName(), automationComposition.getKey().getVersion()); assertNotNull(automationCompositionsFromDb); @@ -261,7 +261,7 @@ class InstantiationControllerTest extends CommonRestController { instResponse = resp.readEntity(InstantiationResponse.class); InstantiationUtils.assertInstantiationResponse(instResponse, automationCompositionFromRsc); - var automationCompositionsFromDb = instantiationProvider.getAutomationCompositions( + var automationCompositionsFromDb = instantiationProvider.getAutomationCompositions(compositionId, automationCompositionFromRsc.getKey().getName(), automationCompositionFromRsc.getKey().getVersion()); assertThat(automationCompositionsFromDb.getAutomationCompositionList()).isEmpty(); } @@ -327,8 +327,8 @@ class InstantiationControllerTest extends CommonRestController { // check passive state on DB var toscaConceptIdentifier = instResponse.getAffectedAutomationComposition(); - var automationCompositionsGet = instantiationProvider - .getAutomationCompositions(toscaConceptIdentifier.getName(), toscaConceptIdentifier.getVersion()); + var automationCompositionsGet = instantiationProvider.getAutomationCompositions(compositionId, + toscaConceptIdentifier.getName(), toscaConceptIdentifier.getVersion()); assertThat(automationCompositionsGet.getAutomationCompositionList()).hasSize(1); assertEquals(command.getOrderedState(), automationCompositionsGet.getAutomationCompositionList().get(0).getOrderedState()); |