aboutsummaryrefslogtreecommitdiffstats
path: root/participant/participant-intermediary/src/test
diff options
context:
space:
mode:
authorFrancescoFioraEst <francesco.fiora@est.tech>2023-06-02 12:36:45 +0100
committerFrancesco Fiora <francesco.fiora@est.tech>2023-06-06 08:32:42 +0000
commitd58c0ca04ae993702b2c399afd52b01e503ec0fe (patch)
tree45ab9c6019c79ed3a0814258e06d98219787f03d /participant/participant-intermediary/src/test
parentebb4d0cf867d752ae148880dd0109fc3cf6d6025 (diff)
Add Failure handling support in all ACM-participants
In any transition (like deploy, undeploy,  lock, unlock, update, delete) a participant should respond with the final state of transition, a status indicator (stateChaneResult) indicating if error has occurred and a message. Issue-ID: POLICY-4706 Change-Id: I424bc6d620f476392baee8904e21d3a6c7aa8d6b Signed-off-by: FrancescoFioraEst <francesco.fiora@est.tech>
Diffstat (limited to 'participant/participant-intermediary/src/test')
-rw-r--r--participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/api/impl/ParticipantIntermediaryApiImplTest.java3
-rw-r--r--participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/handler/DummyAcElementListener.java28
2 files changed, 30 insertions, 1 deletions
diff --git a/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/api/impl/ParticipantIntermediaryApiImplTest.java b/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/api/impl/ParticipantIntermediaryApiImplTest.java
index aa39f5a3f..8f70bc7d9 100644
--- a/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/api/impl/ParticipantIntermediaryApiImplTest.java
+++ b/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/api/impl/ParticipantIntermediaryApiImplTest.java
@@ -30,6 +30,7 @@ import org.onap.policy.clamp.acm.participant.intermediary.api.AutomationComposit
import org.onap.policy.clamp.acm.participant.intermediary.handler.AutomationCompositionHandler;
import org.onap.policy.clamp.models.acm.concepts.DeployState;
import org.onap.policy.clamp.models.acm.concepts.LockState;
+import org.onap.policy.clamp.models.acm.concepts.StateChangeResult;
import org.onap.policy.common.utils.coder.CoderException;
class ParticipantIntermediaryApiImplTest {
@@ -50,7 +51,7 @@ class ParticipantIntermediaryApiImplTest {
var uuid = UUID.randomUUID();
var automationCompositionId = UUID.randomUUID();
apiImpl.updateAutomationCompositionElementState(automationCompositionId, uuid, DeployState.UNDEPLOYED,
- LockState.NONE, null);
+ LockState.NONE, StateChangeResult.NO_ERROR, null);
verify(automationComposiitonHandler).updateAutomationCompositionElementState(automationCompositionId, uuid,
DeployState.UNDEPLOYED, LockState.NONE, null);
diff --git a/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/handler/DummyAcElementListener.java b/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/handler/DummyAcElementListener.java
index b88ea03e5..0a724ed69 100644
--- a/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/handler/DummyAcElementListener.java
+++ b/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/handler/DummyAcElementListener.java
@@ -20,10 +20,12 @@
package org.onap.policy.clamp.acm.participant.intermediary.handler;
+import java.util.List;
import java.util.Map;
import java.util.UUID;
import org.onap.policy.clamp.acm.participant.intermediary.api.AutomationCompositionElementListener;
import org.onap.policy.clamp.models.acm.concepts.AcElementDeploy;
+import org.onap.policy.clamp.models.acm.concepts.AutomationCompositionElementDefinition;
import org.onap.policy.models.base.PfModelException;
public class DummyAcElementListener implements AutomationCompositionElementListener {
@@ -37,4 +39,30 @@ public class DummyAcElementListener implements AutomationCompositionElementListe
throws PfModelException {
}
+
+ @Override
+ public void lock(UUID automationCompositionId, UUID automationCompositionElementId) throws PfModelException {
+ }
+
+ @Override
+ public void unlock(UUID automationCompositionId, UUID automationCompositionElementId) throws PfModelException {
+ }
+
+ @Override
+ public void delete(UUID automationCompositionId, UUID automationCompositionElementId) throws PfModelException {
+ }
+
+ @Override
+ public void update(UUID automationCompositionId, AcElementDeploy element, Map<String, Object> properties)
+ throws PfModelException {
+ }
+
+ @Override
+ public void prime(UUID compositionId, List<AutomationCompositionElementDefinition> elementDefinitionList)
+ throws PfModelException {
+ }
+
+ @Override
+ public void deprime(UUID compositionId) throws PfModelException {
+ }
}