summaryrefslogtreecommitdiffstats
path: root/src/test
diff options
context:
space:
mode:
authorSébastien Determe <sebastien.determe@intl.att.com>2019-12-09 13:43:34 +0000
committerGerrit Code Review <gerrit@onap.org>2019-12-09 13:43:34 +0000
commit4d8c1ab21a3f5baf82a91a3cc9ab2af8823e6e34 (patch)
tree364f0d38698e815f0da0f3a0bf189c4b6f4af744 /src/test
parent47767ece79658f9c2f20fe77af6cee0ca6c027df (diff)
parent69c24994501aead95d5ee9fa172fff659ae34fa4 (diff)
Merge "Update service object"
Diffstat (limited to 'src/test')
-rw-r--r--src/test/java/org/onap/clamp/clds/it/sdc/controller/SdcSingleControllerItCase.java2
-rw-r--r--src/test/java/org/onap/clamp/loop/CsarInstallerItCase.java9
-rw-r--r--src/test/java/org/onap/clamp/loop/LoopToJsonTest.java2
-rw-r--r--src/test/java/org/onap/clamp/loop/ServiceTest.java6
-rw-r--r--src/test/java/org/onap/clamp/policy/operational/OperationalPolicyRepresentationBuilderTest.java2
5 files changed, 13 insertions, 8 deletions
diff --git a/src/test/java/org/onap/clamp/clds/it/sdc/controller/SdcSingleControllerItCase.java b/src/test/java/org/onap/clamp/clds/it/sdc/controller/SdcSingleControllerItCase.java
index 695b85166..2cbabbe8c 100644
--- a/src/test/java/org/onap/clamp/clds/it/sdc/controller/SdcSingleControllerItCase.java
+++ b/src/test/java/org/onap/clamp/clds/it/sdc/controller/SdcSingleControllerItCase.java
@@ -45,7 +45,7 @@ import org.onap.clamp.clds.exception.sdc.controller.SdcControllerException;
import org.onap.clamp.clds.sdc.controller.SdcSingleController;
import org.onap.clamp.clds.sdc.controller.SdcSingleControllerStatus;
import org.onap.clamp.clds.sdc.controller.installer.CsarHandler;
-import org.onap.clamp.clds.sdc.controller.installer.CsarInstaller;
+import org.onap.clamp.loop.CsarInstaller;
import org.onap.sdc.api.notification.IArtifactInfo;
import org.onap.sdc.api.notification.INotificationData;
import org.onap.sdc.api.notification.IResourceInstance;
diff --git a/src/test/java/org/onap/clamp/loop/CsarInstallerItCase.java b/src/test/java/org/onap/clamp/loop/CsarInstallerItCase.java
index e3271c7a6..df952aa16 100644
--- a/src/test/java/org/onap/clamp/loop/CsarInstallerItCase.java
+++ b/src/test/java/org/onap/clamp/loop/CsarInstallerItCase.java
@@ -48,9 +48,9 @@ import org.onap.clamp.clds.exception.sdc.controller.CsarHandlerException;
import org.onap.clamp.clds.exception.sdc.controller.SdcArtifactInstallerException;
import org.onap.clamp.clds.sdc.controller.installer.BlueprintArtifact;
import org.onap.clamp.clds.sdc.controller.installer.CsarHandler;
-import org.onap.clamp.clds.sdc.controller.installer.CsarInstaller;
import org.onap.clamp.clds.util.JsonUtils;
import org.onap.clamp.clds.util.ResourceFileUtil;
+import org.onap.clamp.loop.service.ServiceRepository;
import org.onap.clamp.policy.microservice.MicroServicePolicy;
import org.onap.sdc.api.notification.IArtifactInfo;
import org.onap.sdc.api.notification.INotificationData;
@@ -83,7 +83,10 @@ public class CsarInstallerItCase {
private LoopsRepository loopsRepo;
@Autowired
- @Qualifier("loopInstaller")
+ ServiceRepository serviceRepository;
+
+ @Autowired
+ @Qualifier("csarInstaller")
private CsarInstaller csarInstaller;
private BlueprintArtifact buildFakeBuildprintArtifact(String instanceName, String invariantResourceUuid,
@@ -186,6 +189,8 @@ public class CsarInstallerItCase {
String generatedName = RandomStringUtils.randomAlphanumeric(5);
CsarHandler csar = buildFakeCsarHandler(generatedName);
csarInstaller.installTheCsar(csar);
+ assertThat(serviceRepository
+ .existsById("63cac700-ab9a-4115-a74f-7eac85e3fce0")).isTrue();
assertThat(loopsRepo
.existsById(Loop.generateLoopName(generatedName, "1.0", RESOURCE_INSTANCE_NAME_RESOURCE1, "tca.yaml")))
.isTrue();
diff --git a/src/test/java/org/onap/clamp/loop/LoopToJsonTest.java b/src/test/java/org/onap/clamp/loop/LoopToJsonTest.java
index b68bf48a0..68fe487ef 100644
--- a/src/test/java/org/onap/clamp/loop/LoopToJsonTest.java
+++ b/src/test/java/org/onap/clamp/loop/LoopToJsonTest.java
@@ -126,7 +126,7 @@ public class LoopToJsonTest {
JsonObject jsonModel = new GsonBuilder().create()
.fromJson(ResourceFileUtil.getResourceAsString("tosca/model-properties.json"), JsonObject.class);
Service service = new Service(jsonModel.get("serviceDetails").getAsJsonObject(),
- jsonModel.get("resourceDetails").getAsJsonObject());
+ jsonModel.get("resourceDetails").getAsJsonObject(), "1.0");
loopTest2.setModelService(service);
String jsonSerialized = JsonUtils.GSON_JPA_MODEL.toJson(loopTest2);
diff --git a/src/test/java/org/onap/clamp/loop/ServiceTest.java b/src/test/java/org/onap/clamp/loop/ServiceTest.java
index 45de5385e..2b6fab8b6 100644
--- a/src/test/java/org/onap/clamp/loop/ServiceTest.java
+++ b/src/test/java/org/onap/clamp/loop/ServiceTest.java
@@ -41,12 +41,12 @@ public class ServiceTest {
String resourceStr = "{\"CP\": {}}";
Service service1 = new Service(JsonUtils.GSON.fromJson(serviceStr1, JsonObject.class),
- JsonUtils.GSON.fromJson(resourceStr, JsonObject.class));
+ JsonUtils.GSON.fromJson(resourceStr, JsonObject.class), "1.0");
- Service service2 = new Service(JsonUtils.GSON.fromJson(serviceStr2, JsonObject.class), null);
+ Service service2 = new Service(JsonUtils.GSON.fromJson(serviceStr2, JsonObject.class), null, "1.0");
Service service3 = new Service(JsonUtils.GSON.fromJson(serviceStr3, JsonObject.class),
- JsonUtils.GSON.fromJson(resourceStr, JsonObject.class));
+ JsonUtils.GSON.fromJson(resourceStr, JsonObject.class), "1.0");
assertThat(service1.equals(service2)).isEqualTo(true);
assertThat(service1.equals(service3)).isEqualTo(false);
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 673ac323d..12ddbaa71 100644
--- a/src/test/java/org/onap/clamp/policy/operational/OperationalPolicyRepresentationBuilderTest.java
+++ b/src/test/java/org/onap/clamp/policy/operational/OperationalPolicyRepresentationBuilderTest.java
@@ -42,7 +42,7 @@ public class OperationalPolicyRepresentationBuilderTest {
JsonObject jsonModel = new GsonBuilder().create()
.fromJson(ResourceFileUtil.getResourceAsString("tosca/model-properties.json"), JsonObject.class);
Service service = new Service(jsonModel.get("serviceDetails").getAsJsonObject(),
- jsonModel.get("resourceDetails").getAsJsonObject());
+ jsonModel.get("resourceDetails").getAsJsonObject(), "1.0");
JsonObject jsonSchema = OperationalPolicyRepresentationBuilder.generateOperationalPolicySchema(service);