diff options
author | FrancescoFioraEst <francesco.fiora@est.tech> | 2023-08-08 16:58:25 +0100 |
---|---|---|
committer | Adheli Tavares <adheli.tavares@est.tech> | 2023-08-09 15:52:29 +0000 |
commit | d81827b4a2dc286b34ca2d13221d6766fcff429e (patch) | |
tree | 0ebb63b0ae00e6c2f0a493ee02db6dac68276ed7 /participant/participant-intermediary/src/test/java | |
parent | b3ff1f966aeaf94053619700cb3dfd1b123e72a9 (diff) |
Add composition outProperties support in Deprime
Issue-ID: POLICY-4784
Change-Id: I8d97d1cebc92c29b4b6842ad31f653664c09b0bf
Signed-off-by: FrancescoFioraEst <francesco.fiora@est.tech>
(cherry picked from commit ea5f81815a19d0b902e3c80f15d1b17c122bce76)
Diffstat (limited to 'participant/participant-intermediary/src/test/java')
2 files changed, 17 insertions, 3 deletions
diff --git a/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/handler/AutomationCompositionOutHandlerTest.java b/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/handler/AutomationCompositionOutHandlerTest.java index 36c0c4b35..4f2ee8381 100755 --- a/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/handler/AutomationCompositionOutHandlerTest.java +++ b/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/handler/AutomationCompositionOutHandlerTest.java @@ -166,13 +166,28 @@ class AutomationCompositionOutHandlerTest { } @Test - void updateCompositionStateTest() { + void updateCompositionStatePrimedTest() { var cacheProvider = mock(CacheProvider.class); when(cacheProvider.getParticipantId()).thenReturn(UUID.randomUUID()); var publisher = mock(ParticipantMessagePublisher.class); var acOutHandler = new AutomationCompositionOutHandler(publisher, cacheProvider); - acOutHandler.updateCompositionState(UUID.randomUUID(), AcTypeState.PRIMED, StateChangeResult.NO_ERROR, + var compositionId = UUID.randomUUID(); + acOutHandler.updateCompositionState(compositionId, AcTypeState.PRIMED, StateChangeResult.NO_ERROR, "Primed"); verify(publisher).sendParticipantPrimeAck(any(ParticipantPrimeAck.class)); + verify(cacheProvider, times(0)).removeElementDefinition(compositionId); + } + + @Test + void updateCompositionStateDeprimingTest() { + var cacheProvider = mock(CacheProvider.class); + when(cacheProvider.getParticipantId()).thenReturn(UUID.randomUUID()); + var publisher = mock(ParticipantMessagePublisher.class); + var acOutHandler = new AutomationCompositionOutHandler(publisher, cacheProvider); + var compositionId = UUID.randomUUID(); + acOutHandler.updateCompositionState(compositionId, AcTypeState.COMMISSIONED, StateChangeResult.NO_ERROR, + "Deprimed"); + verify(publisher).sendParticipantPrimeAck(any(ParticipantPrimeAck.class)); + verify(cacheProvider).removeElementDefinition(compositionId); } } diff --git a/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/handler/ParticipantHandlerTest.java b/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/handler/ParticipantHandlerTest.java index 68cffe3cd..2f1eb2273 100644 --- a/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/handler/ParticipantHandlerTest.java +++ b/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/handler/ParticipantHandlerTest.java @@ -208,7 +208,6 @@ class ParticipantHandlerTest { var messageId = UUID.randomUUID(); participantPrime.setMessageId(messageId); participantHandler.handleParticipantPrime(participantPrime); - verify(cacheProvider).removeElementDefinition(compositionId); verify(acHandler).deprime(messageId, compositionId); } |