From 645ace3d5b8ce8600c0c58d58e5c6b887fd284e4 Mon Sep 17 00:00:00 2001 From: FrancescoFioraEst Date: Thu, 4 Jan 2024 12:48:32 +0000 Subject: Add OutProperties support for restart scenario in participant Add OutProperties instance support for restart scenario in participant intermediary. Issue-ID: POLICY-4910 Change-Id: I70d00135de9735a10a6c5688bf7ee6b698266412 Signed-off-by: FrancescoFioraEst --- .../acm/participant/intermediary/handler/CacheProvider.java | 3 +++ .../acm/participant/intermediary/handler/CacheProviderTest.java | 9 +++++++++ .../participant/intermediary/main/parameters/CommonTestData.java | 4 ++++ 3 files changed, 16 insertions(+) (limited to 'participant') diff --git a/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/handler/CacheProvider.java b/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/handler/CacheProvider.java index dc1bb051a..cc61c4739 100644 --- a/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/handler/CacheProvider.java +++ b/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/handler/CacheProvider.java @@ -174,7 +174,10 @@ public class CacheProvider { acElement.setDefinition(element.getDefinition()); acElement.setDeployState(element.getDeployState()); acElement.setLockState(element.getLockState()); + acElement.setOperationalState(element.getOperationalState()); + acElement.setUseState(element.getUseState()); acElement.setProperties(element.getProperties()); + acElement.setOutProperties(element.getOutProperties()); acElement.setRestarting(true); acElementMap.put(element.getId(), acElement); } diff --git a/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/handler/CacheProviderTest.java b/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/handler/CacheProviderTest.java index e55de0192..33bd93fb2 100644 --- a/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/handler/CacheProviderTest.java +++ b/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/handler/CacheProviderTest.java @@ -153,5 +153,14 @@ class CacheProviderTest { var result = cacheProvider.getAutomationComposition(participantRestartAc.getAutomationCompositionId()); assertEquals(compositionId, result.getCompositionId()); assertEquals(participantRestartAc.getAutomationCompositionId(), result.getInstanceId()); + for (var acElementRestart : participantRestartAc.getAcElementList()) { + var element = result.getElements().get(acElementRestart.getId()); + assertEquals(element.getOperationalState(), acElementRestart.getOperationalState()); + assertEquals(element.getUseState(), acElementRestart.getUseState()); + assertEquals(element.getLockState(), acElementRestart.getLockState()); + assertEquals(element.getDeployState(), acElementRestart.getDeployState()); + assertEquals(element.getProperties(), acElementRestart.getProperties()); + assertEquals(element.getOutProperties(), acElementRestart.getOutProperties()); + } } } diff --git a/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/main/parameters/CommonTestData.java b/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/main/parameters/CommonTestData.java index 46894fb43..4345d48c4 100644 --- a/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/main/parameters/CommonTestData.java +++ b/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/main/parameters/CommonTestData.java @@ -237,6 +237,10 @@ public class CommonTestData { acElementRestart.setDefinition(getDefinition()); acElementRestart.setDeployState(DeployState.DEPLOYED); acElementRestart.setLockState(LockState.LOCKED); + acElementRestart.setOperationalState("OperationalState"); + acElementRestart.setUseState("UseState"); + acElementRestart.setProperties(Map.of("key", "value")); + acElementRestart.setOutProperties(Map.of("keyOut", "valueOut")); acElementRestart.setId(UUID.randomUUID()); participantRestartAc.getAcElementList().add(acElementRestart); return participantRestartAc; -- cgit 1.2.3-korg