summaryrefslogtreecommitdiffstats
path: root/participant
diff options
context:
space:
mode:
authorFrancescoFioraEst <francesco.fiora@est.tech>2024-01-04 12:48:32 +0000
committerFrancesco Fiora <francesco.fiora@est.tech>2024-01-05 11:05:11 +0000
commit645ace3d5b8ce8600c0c58d58e5c6b887fd284e4 (patch)
treec6461d4c8be231d6c1d80c3e55fc99709ebf20d8 /participant
parent7e3aca8c749858a293eec5568f38177bba711219 (diff)
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 <francesco.fiora@est.tech>
Diffstat (limited to 'participant')
-rw-r--r--participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/handler/CacheProvider.java3
-rw-r--r--participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/handler/CacheProviderTest.java9
-rw-r--r--participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/main/parameters/CommonTestData.java4
3 files changed, 16 insertions, 0 deletions
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;