summaryrefslogtreecommitdiffstats
path: root/bpmn/MSOCoreBPMN/src/test
diff options
context:
space:
mode:
authorsubhash kumar singh <subhash.kumar.singh@huawei.com>2019-04-26 17:08:40 +0530
committersubhash kumar singh <subhash.kumar.singh@huawei.com>2019-04-27 12:51:43 +0530
commite98c9cbc978ceb3bcb4a8f946bfec4cbd7b22511 (patch)
tree5a35261434240d6ea24a48d7230496408b3ea20f /bpmn/MSOCoreBPMN/src/test
parent80462c509ef9ce3241b4cdf3e7f8fe5f6ab74974 (diff)
Enhanced Service decomposition to handle gruop
Enhanced Service decomposition to handle gruop and vnfcs Issue-ID: SO-1393 Change-Id: If28416e4776f2ff645abdd0d1059d28c9ca6e52f Signed-off-by: subhash kumar singh <subhash.kumar.singh@huawei.com>
Diffstat (limited to 'bpmn/MSOCoreBPMN/src/test')
-rw-r--r--bpmn/MSOCoreBPMN/src/test/java/org/onap/so/bpmn/core/domain/ServiceDecompositionTest.java16
-rw-r--r--bpmn/MSOCoreBPMN/src/test/java/org/onap/so/bpmn/core/domain/VnfResourceTest.java7
-rw-r--r--bpmn/MSOCoreBPMN/src/test/resources/json-examples/ServiceWithGroupandVnfc.json58
3 files changed, 78 insertions, 3 deletions
diff --git a/bpmn/MSOCoreBPMN/src/test/java/org/onap/so/bpmn/core/domain/ServiceDecompositionTest.java b/bpmn/MSOCoreBPMN/src/test/java/org/onap/so/bpmn/core/domain/ServiceDecompositionTest.java
index 5db277628e..7ef7deea30 100644
--- a/bpmn/MSOCoreBPMN/src/test/java/org/onap/so/bpmn/core/domain/ServiceDecompositionTest.java
+++ b/bpmn/MSOCoreBPMN/src/test/java/org/onap/so/bpmn/core/domain/ServiceDecompositionTest.java
@@ -52,6 +52,22 @@ public class ServiceDecompositionTest {
configResource.setResourceId("configResourceId");
}
+
+ @Test
+ public void serviceDecompositionWithGroupandVnfc() throws IOException {
+ String sericeStr = new String(Files.readAllBytes(Paths.get(RESOURCE_PATH + "ServiceWithGroupandVnfc.json")));
+ ServiceDecomposition serviceDecomposition = new ServiceDecomposition(sericeStr);
+
+ assertEquals(1, serviceDecomposition.getVnfResources().size());
+ assertEquals(1, serviceDecomposition.getVnfResources().get(0).getGroups().size());
+ assertEquals(1, serviceDecomposition.getVnfResources().get(0).getGroups().get(0).getVnfcs().size());
+
+ VnfcResource vnfcResource = serviceDecomposition.getVnfResources().get(0).getGroups().get(0).getVnfcs().get(0);
+
+ assertEquals("xfs", vnfcResource.getModelInfo().getModelName());
+ assertEquals("22", vnfcResource.getModelInfo().getModelUuid());
+ }
+
@Test
public void serviceDecompositionTest() throws JsonProcessingException, IOException {
// covering methods not covered by openpojo test
diff --git a/bpmn/MSOCoreBPMN/src/test/java/org/onap/so/bpmn/core/domain/VnfResourceTest.java b/bpmn/MSOCoreBPMN/src/test/java/org/onap/so/bpmn/core/domain/VnfResourceTest.java
index b23633b4d8..de7b21ed73 100644
--- a/bpmn/MSOCoreBPMN/src/test/java/org/onap/so/bpmn/core/domain/VnfResourceTest.java
+++ b/bpmn/MSOCoreBPMN/src/test/java/org/onap/so/bpmn/core/domain/VnfResourceTest.java
@@ -14,12 +14,13 @@
*/
package org.onap.so.bpmn.core.domain;
-import static org.junit.Assert.*;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.junit.Test;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import org.junit.Test;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
public class VnfResourceTest {
diff --git a/bpmn/MSOCoreBPMN/src/test/resources/json-examples/ServiceWithGroupandVnfc.json b/bpmn/MSOCoreBPMN/src/test/resources/json-examples/ServiceWithGroupandVnfc.json
new file mode 100644
index 0000000000..9d0326e66a
--- /dev/null
+++ b/bpmn/MSOCoreBPMN/src/test/resources/json-examples/ServiceWithGroupandVnfc.json
@@ -0,0 +1,58 @@
+{
+ "serviceResources": {
+ "modelInfo": {
+ "modelName": "NSService",
+ "modelUuid": "0bad8c92-7d22-49f0-b092-b64e6ca564a7",
+ "modelInvariantUuid": "69161960-515b-4bf3-91f1-313b813f5e1d",
+ "modelVersion": "1.0"
+ },
+ "serviceType": "",
+ "serviceRole": "",
+ "environmentContext": "General_Revenue-Bearing",
+ "resourceOrder": "NF",
+ "workloadContext": "Production",
+ "serviceVnfs": [
+ {
+ "modelInfo": {
+ "modelName": "",
+ "modelUuid": "123",
+ "modelInvariantUuid": "",
+ "modelVersion": "",
+ "modelCustomizationUuid": "1234",
+ "modelInstanceName": "test"
+ },
+ "toscaNodeType": "",
+ "nfFunction": "",
+ "nfType": "",
+ "nfRole": "",
+ "nfNamingCode": "",
+ "multiStageDesign": "",
+ "resourceInput": "",
+ "vfModules": [],
+ "groups": [
+ {
+ "modelInfo": {
+ "modelName": "test",
+ "modelUuid": "11",
+ "modelInvariantUuid": "11",
+ "modelVersion": "2"
+ },
+ "vnfcs": [
+ {
+ "modelInfo": {
+ "modelName": "xfs",
+ "modelUuid": "22",
+ "modelInvariantUuid": "2222",
+ "modelVersion": "22222",
+ "modelCustomizationUuid": "2222"
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ],
+ "serviceNetworks": [],
+ "serviceAllottedResources": []
+ }
+} \ No newline at end of file