diff options
author | FrancescoFioraEst <francesco.fiora@est.tech> | 2022-12-14 16:57:00 +0000 |
---|---|---|
committer | Liam Fallon <liam.fallon@est.tech> | 2022-12-16 13:36:43 +0000 |
commit | e18a523f4fc8075dc5022871fa96ca8754c2c979 (patch) | |
tree | 28169f3610588173fa078a6edd0e2be0eb59b125 /runtime-acm/src/test/java | |
parent | 0b5e99601abc5290d241f2082f12758ea46231ef (diff) |
Refactor instanceId as primary key in JpaAutomationComposition
Issue-ID: POLICY-4480
Change-Id: I4d3bd44c23378b428beb901d78ea48dcdbbe7f44
Signed-off-by: FrancescoFioraEst <francesco.fiora@est.tech>
Diffstat (limited to 'runtime-acm/src/test/java')
2 files changed, 6 insertions, 6 deletions
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()); |