aboutsummaryrefslogtreecommitdiffstats
path: root/models/src/test/java
diff options
context:
space:
mode:
Diffstat (limited to 'models/src/test/java')
-rw-r--r--models/src/test/java/org/onap/policy/clamp/models/acm/messages/dmaap/participant/ParticipantRestartTest.java10
-rw-r--r--models/src/test/java/org/onap/policy/clamp/models/acm/utils/AcmUtilsTest.java12
2 files changed, 15 insertions, 7 deletions
diff --git a/models/src/test/java/org/onap/policy/clamp/models/acm/messages/dmaap/participant/ParticipantRestartTest.java b/models/src/test/java/org/onap/policy/clamp/models/acm/messages/dmaap/participant/ParticipantRestartTest.java
index 1ae607ebe..ba84ac76f 100644
--- a/models/src/test/java/org/onap/policy/clamp/models/acm/messages/dmaap/participant/ParticipantRestartTest.java
+++ b/models/src/test/java/org/onap/policy/clamp/models/acm/messages/dmaap/participant/ParticipantRestartTest.java
@@ -29,9 +29,7 @@ import java.time.Instant;
import java.util.List;
import java.util.UUID;
import org.junit.jupiter.api.Test;
-import org.onap.policy.clamp.models.acm.concepts.AcElementDeploy;
-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.AcElementRestart;
import org.onap.policy.clamp.models.acm.concepts.ParticipantDefinition;
import org.onap.policy.clamp.models.acm.concepts.ParticipantRestartAc;
import org.onap.policy.clamp.models.acm.utils.CommonTestData;
@@ -60,7 +58,7 @@ class ParticipantRestartTest {
participantDefinitionUpdate.setAutomationCompositionElementDefinitionList(List.of(acDefinition));
orig.setParticipantDefinitionUpdates(List.of(participantDefinitionUpdate));
- var acElement = new AcElementDeploy();
+ var acElement = new AcElementRestart();
acElement.setId(UUID.randomUUID());
var id = new ToscaConceptIdentifier("id", "1.2.3");
acElement.setDefinition(id);
@@ -68,10 +66,8 @@ class ParticipantRestartTest {
var acRestart = new ParticipantRestartAc();
acRestart.setAcElementList(List.of(acElement));
acRestart.setAutomationCompositionId(UUID.randomUUID());
- acRestart.setDeployState(DeployState.DEPLOYED);
- acRestart.setLockState(LockState.LOCKED);
- orig.setAutocompositionList(List.of(acRestart));
+ orig.setAutomationcompositionList(List.of(acRestart));
assertEquals(removeVariableFields(orig.toString()),
removeVariableFields(new ParticipantRestart(orig).toString()));
diff --git a/models/src/test/java/org/onap/policy/clamp/models/acm/utils/AcmUtilsTest.java b/models/src/test/java/org/onap/policy/clamp/models/acm/utils/AcmUtilsTest.java
index 7e8f60525..a9bd25f81 100644
--- a/models/src/test/java/org/onap/policy/clamp/models/acm/utils/AcmUtilsTest.java
+++ b/models/src/test/java/org/onap/policy/clamp/models/acm/utils/AcmUtilsTest.java
@@ -66,6 +66,8 @@ class AcmUtilsTest {
assertThat(AcmUtils.isInTransitionalState(DeployState.UNDEPLOYING, LockState.NONE)).isTrue();
assertThat(AcmUtils.isInTransitionalState(DeployState.DEPLOYED, LockState.LOCKING)).isTrue();
assertThat(AcmUtils.isInTransitionalState(DeployState.DEPLOYED, LockState.UNLOCKING)).isTrue();
+ assertThat(AcmUtils.isInTransitionalState(DeployState.DELETING, LockState.NONE)).isTrue();
+ assertThat(AcmUtils.isInTransitionalState(DeployState.UPDATING, LockState.LOCKED)).isTrue();
}
@Test
@@ -192,6 +194,16 @@ class AcmUtilsTest {
assertEquals(element.getDefinition(), result.getDefinition());
}
+ @Test
+ void testCreateAcElementRestart() {
+ var element = getDummyAutomationComposition().getElements().values().iterator().next();
+ var result = AcmUtils.createAcElementRestart(element);
+ assertEquals(element.getId(), result.getId());
+ assertEquals(element.getDefinition(), result.getDefinition());
+ assertEquals(element.getDeployState(), result.getDeployState());
+ assertEquals(element.getLockState(), result.getLockState());
+ }
+
private AutomationComposition getDummyAutomationComposition() {
var automationComposition = new AutomationComposition();
automationComposition.setCompositionId(UUID.randomUUID());