diff options
author | sebdet <sebastien.determe@intl.att.com> | 2019-05-09 16:50:17 +0200 |
---|---|---|
committer | sebdet <sebastien.determe@intl.att.com> | 2019-05-09 17:05:36 +0200 |
commit | aa7fd8ddced2e3218fa85e131e1eff59ff33e22f (patch) | |
tree | 4ee111943c0b1054c647d576c371c440ea724017 /src/test/java/org | |
parent | ce3e2f425911b6a4cc68e61b482bcd73a2cff8a4 (diff) |
Generate Random UUID for DCAE
Generate random UUI for DCAE deployment during deploy action
Issue-ID: CLAMP-376
Change-Id: Idfc1959891738f0142d2c20e1f43f1ad45d8eaa7
Signed-off-by: sebdet <sebastien.determe@intl.att.com>
Diffstat (limited to 'src/test/java/org')
-rw-r--r-- | src/test/java/org/onap/clamp/loop/LoopOperationTestItCase.java | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/src/test/java/org/onap/clamp/loop/LoopOperationTestItCase.java b/src/test/java/org/onap/clamp/loop/LoopOperationTestItCase.java index 93274788..a2c97e0c 100644 --- a/src/test/java/org/onap/clamp/loop/LoopOperationTestItCase.java +++ b/src/test/java/org/onap/clamp/loop/LoopOperationTestItCase.java @@ -55,15 +55,12 @@ public class LoopOperationTestItCase { LoopService loopService; private Loop createTestLoop() { - String yaml = "imports:\n" - + " - \"http://www.getcloudify.org/spec/cloudify/3.4/types.yaml\"\n" - + "node_templates:\n" - + " docker_service_host:\n" - + " type: dcae.nodes.SelectedDockerHost"; + String yaml = "imports:\n" + " - \"http://www.getcloudify.org/spec/cloudify/3.4/types.yaml\"\n" + + "node_templates:\n" + " docker_service_host:\n" + " type: dcae.nodes.SelectedDockerHost"; Loop loopTest = new Loop("ControlLoopTest", yaml, "<xml></xml>"); - loopTest.setGlobalPropertiesJson(new Gson().fromJson("{\"dcaeDeployParameters\":" - + "{\"policy_id\": \"name\"}}", JsonObject.class)); + loopTest.setGlobalPropertiesJson( + new Gson().fromJson("{\"dcaeDeployParameters\":" + "{\"policy_id\": \"name\"}}", JsonObject.class)); loopTest.setLastComputedState(LoopState.DESIGN); loopTest.setDcaeDeploymentId("123456789"); loopTest.setDcaeDeploymentStatusUrl("http4://localhost:8085"); @@ -71,14 +68,13 @@ public class LoopOperationTestItCase { MicroServicePolicy microServicePolicy = new MicroServicePolicy("configPolicyTest", "", "tosca_definitions_version: tosca_simple_yaml_1_0_0", true, - gson.fromJson("{\"configtype\":\"json\"}", JsonObject.class), new HashSet<>()); + gson.fromJson("{\"configtype\":\"json\"}", JsonObject.class), new HashSet<>()); microServicePolicy.setProperties(new Gson().fromJson("{\"param1\":\"value1\"}", JsonObject.class)); loopTest.addMicroServicePolicy(microServicePolicy); return loopTest; } - @Test public void testAnalysePolicyResponse() { LoopOperation loopOp = new LoopOperation(loopService); @@ -102,7 +98,7 @@ public class LoopOperationTestItCase { assertThat(opName1).isNull(); OperationalPolicy opPolicy1 = new OperationalPolicy("OperationalPolicyTest1", null, - gson.fromJson("{\"type\":\"Operational\"}", JsonObject.class)); + gson.fromJson("{\"type\":\"Operational\"}", JsonObject.class)); loop.addOperationalPolicy(opPolicy1); String opName2 = loopOp.getOperationalPolicyName(loop); assertThat(opName2).isEqualTo("OperationalPolicyTest1"); @@ -212,7 +208,7 @@ public class LoopOperationTestItCase { loopOp.updateLoopInfo(camelExchange, loop, "testNewId"); Loop newLoop = loopService.getLoop(loop.getName()); - String newDeployId = newLoop.getDcaeDeploymentId(); + String newDeployId = newLoop.getDcaeDeploymentId(); String newDeploymentStatusUrl = newLoop.getDcaeDeploymentStatusUrl(); assertThat(newDeployId).isEqualTo("testNewId"); @@ -228,11 +224,12 @@ public class LoopOperationTestItCase { loop.setDcaeDeploymentId(null); String deploymentId2 = loopOp.getDeploymentId(loop); - assertThat(deploymentId2).isEqualTo("closedLoop_ControlLoopTest_deploymentId"); + assertThat(deploymentId2).startsWith("CLAMP_"); loop.setDcaeDeploymentId(""); String deploymentId3 = loopOp.getDeploymentId(loop); - assertThat(deploymentId3).isEqualTo("closedLoop_ControlLoopTest_deploymentId"); + assertThat(deploymentId3).startsWith("CLAMP_"); + assertThat(deploymentId3).isNotEqualTo(deploymentId2); } @Test |