diff options
author | Christophe Closset <christophe.closset@intl.att.com> | 2020-04-23 08:49:12 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2020-04-23 08:49:12 +0000 |
commit | e57ccc972e080ce039d7a1325332fcae3b75bbf1 (patch) | |
tree | 5867a503fd98a4bb67ecdd1badc9d4eb6e52efbf /src/test | |
parent | b954df81bb47b3ff115207a2436f1b61eaeafad2 (diff) | |
parent | d187e9e689fe39cbabe9cb82ea6959e49ff64354 (diff) |
Merge "Fix refresh action"
Diffstat (limited to 'src/test')
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); } } |