aboutsummaryrefslogtreecommitdiffstats
path: root/src/test
diff options
context:
space:
mode:
authorsebdet <sebastien.determe@intl.att.com>2020-04-23 00:44:32 +0200
committersebdet <sebastien.determe@intl.att.com>2020-04-23 02:25:14 +0200
commitd187e9e689fe39cbabe9cb82ea6959e49ff64354 (patch)
tree2f498ab30de3a8979606bdfebeade9018b1f6485 /src/test
parent614956d2662db39e4daf99da1b8302001bd2d8c2 (diff)
Fix refresh action
Fix the refresh action so that it well retriggered cds call when required, otherwise the refresh button is useless + get out the cds code from service installer Issue-ID: CLAMP-818 Signed-off-by: sebdet <sebastien.determe@intl.att.com> Change-Id: Ia5784d75e1bd158ff775674fe6bf0c2c39b55ad4
Diffstat (limited to 'src/test')
-rw-r--r--src/test/java/org/onap/clamp/clds/client/CdsServicesTest.java2
-rw-r--r--src/test/java/org/onap/clamp/loop/CsarInstallerItCase.java8
-rw-r--r--src/test/java/org/onap/clamp/policy/operational/OperationalPolicyRepresentationBuilderTest.java9
3 files changed, 11 insertions, 8 deletions
diff --git a/src/test/java/org/onap/clamp/clds/client/CdsServicesTest.java b/src/test/java/org/onap/clamp/clds/client/CdsServicesTest.java
index ec39fc3d..9fdc727b 100644
--- a/src/test/java/org/onap/clamp/clds/client/CdsServicesTest.java
+++ b/src/test/java/org/onap/clamp/clds/client/CdsServicesTest.java
@@ -23,9 +23,7 @@
package org.onap.clamp.clds.client;
import com.google.gson.JsonObject;
-
import java.io.IOException;
-
import org.junit.Test;
import org.onap.clamp.clds.util.JsonUtils;
import org.onap.clamp.clds.util.ResourceFileUtil;
diff --git a/src/test/java/org/onap/clamp/loop/CsarInstallerItCase.java b/src/test/java/org/onap/clamp/loop/CsarInstallerItCase.java
index ac7b236e..d1497523 100644
--- a/src/test/java/org/onap/clamp/loop/CsarInstallerItCase.java
+++ b/src/test/java/org/onap/clamp/loop/CsarInstallerItCase.java
@@ -50,6 +50,7 @@ import org.onap.clamp.clds.sdc.controller.installer.BlueprintArtifact;
import org.onap.clamp.clds.sdc.controller.installer.CsarHandler;
import org.onap.clamp.clds.util.JsonUtils;
import org.onap.clamp.clds.util.ResourceFileUtil;
+import org.onap.clamp.loop.cds.CdsDataInstaller;
import org.onap.clamp.loop.service.ServicesRepository;
import org.onap.clamp.loop.template.LoopTemplate;
import org.onap.clamp.loop.template.LoopTemplateLoopElementModel;
@@ -180,8 +181,7 @@ public class CsarInstallerItCase {
CsarHandler csarHandler = new CsarHandler(notificationData, "", "");
csarHandler
.setFilePath(Thread.currentThread().getContextClassLoader().getResource(CSAR_ARTIFACT_NAME).getFile());
- Optional<String> testyaml = csarHandler.getPolicyModelYaml();
- Assert.assertEquals(testyaml, Optional
+ Assert.assertEquals(csarHandler.getPolicyModelYaml(), Optional
.ofNullable(ResourceFileUtil.getResourceAsString("example/sdc/expected-result/policy-data.yaml")));
}
@@ -205,6 +205,10 @@ public class CsarInstallerItCase {
CsarHandler csar = buildFakeCsarHandler(generatedName);
csarInstaller.installTheCsar(csar);
assertThat(serviceRepository.existsById("63cac700-ab9a-4115-a74f-7eac85e3fce0")).isTrue();
+ // We should have CDS info
+ assertThat(serviceRepository.findById("63cac700-ab9a-4115-a74f-7eac85e3fce0").get().getResourceByType("VF")
+ .getAsJsonObject("vLoadBalancerMS 0").getAsJsonObject(
+ CdsDataInstaller.CONTROLLER_PROPERTIES)).isNotNull();
assertThat(loopTemplatesRepo.existsById(LoopTemplate.generateLoopTemplateName(generatedName, "1.0",
RESOURCE_INSTANCE_NAME_RESOURCE1, "tca.yaml"))).isTrue();
assertThat(loopTemplatesRepo.existsById(LoopTemplate.generateLoopTemplateName(generatedName, "1.0",
diff --git a/src/test/java/org/onap/clamp/policy/operational/OperationalPolicyRepresentationBuilderTest.java b/src/test/java/org/onap/clamp/policy/operational/OperationalPolicyRepresentationBuilderTest.java
index a6a49682..b90a2861 100644
--- a/src/test/java/org/onap/clamp/policy/operational/OperationalPolicyRepresentationBuilderTest.java
+++ b/src/test/java/org/onap/clamp/policy/operational/OperationalPolicyRepresentationBuilderTest.java
@@ -55,12 +55,13 @@ public class OperationalPolicyRepresentationBuilderTest {
JsonObject jsonModel = new GsonBuilder().create()
.fromJson(ResourceFileUtil.getResourceAsString("tosca/model-properties-cds.json"), JsonObject.class);
Service service = new Service(jsonModel.get("serviceDetails").getAsJsonObject(),
- jsonModel.get("resourceDetails").getAsJsonObject(),
- "1.0");
+ jsonModel.get("resourceDetails").getAsJsonObject(),
+ "1.0");
JsonObject jsonSchema = OperationalPolicyRepresentationBuilder.generateOperationalPolicySchema(service);
assertThat(jsonSchema).isNotNull();
- JSONAssert.assertEquals(ResourceFileUtil.getResourceAsString("tosca/operational-policy-cds-payload-with-list.json"),
- new GsonBuilder().create().toJson(jsonSchema), false);
+ JSONAssert.assertEquals(
+ ResourceFileUtil.getResourceAsString("tosca/operational-policy-cds-payload-with-list.json"),
+ new GsonBuilder().create().toJson(jsonSchema), false);
}
}