UT for SOTN Eline in USECASEUI 65/103365/2
authormukesh.paliwal1@huawei.com <mukesh.paliwal1@huawei.com>
Mon, 9 Mar 2020 14:22:47 +0000 (19:52 +0530)
committerMukesh Paliwal <mukesh.paliwal1@huawei.com>
Tue, 10 Mar 2020 04:40:57 +0000 (04:40 +0000)
Issue-ID: USECASEUI-378

Signed-off-by: mukesh.paliwal1@huawei.com <mukesh.paliwal1@huawei.com>
Change-Id: I789e70d23994cedbfd41c1edf82f8a5e114b6df8

16 files changed:
server/src/main/java/org/onap/usecaseui/server/service/lcm/impl/SotnServiceTemplateServiceImpl.java
server/src/test/java/org/onap/usecaseui/server/bean/RelationshipDatumTest.java [new file with mode: 0644]
server/src/test/java/org/onap/usecaseui/server/bean/activeEdge/ComplexObjTest.java [new file with mode: 0644]
server/src/test/java/org/onap/usecaseui/server/bean/activeEdge/RelationshipDatumTest.java [new file with mode: 0644]
server/src/test/java/org/onap/usecaseui/server/bean/activeEdge/RelationshipListTest.java [new file with mode: 0644]
server/src/test/java/org/onap/usecaseui/server/bean/activeEdge/ServiceInstanceTest.java [new file with mode: 0644]
server/src/test/java/org/onap/usecaseui/server/bean/activeEdge/SiteResourceTest.java [new file with mode: 0644]
server/src/test/java/org/onap/usecaseui/server/bean/customer/ServiceInstanceTest.java [new file with mode: 0644]
server/src/test/java/org/onap/usecaseui/server/bean/customer/ServiceInstancesTest.java [new file with mode: 0644]
server/src/test/java/org/onap/usecaseui/server/bean/customer/SubscriptionTest.java [new file with mode: 0644]
server/src/test/java/org/onap/usecaseui/server/bean/customer/SubscriptionTypeTest.java [new file with mode: 0644]
server/src/test/java/org/onap/usecaseui/server/bean/orderservice/ServiceEstimationTest.java [new file with mode: 0644]
server/src/test/java/org/onap/usecaseui/server/bean/orderservice/SiteTest.java [new file with mode: 0644]
server/src/test/java/org/onap/usecaseui/server/bean/orderservice/VpnInformationTest.java [new file with mode: 0644]
server/src/test/java/org/onap/usecaseui/server/service/lcm/impl/SotnServiceQryServiceImplTest.java [new file with mode: 0644]
server/src/test/java/org/onap/usecaseui/server/service/lcm/impl/SotnServiceTemplateServiceImplTest.java [new file with mode: 0644]

index 1179314..2015ae2 100644 (file)
@@ -79,7 +79,6 @@ public class SotnServiceTemplateServiceImpl implements SotnServiceTemplateServic
         try {
 
             Object object = parser.parse(new FileReader(jsonPath));
-            // System.out.println("mukesh"+object.toString());
             ModelConfig modelInformation = mapper.readValue(object.toString(), new TypeReference<ModelConfig>() {
             });
 
@@ -100,7 +99,6 @@ public class SotnServiceTemplateServiceImpl implements SotnServiceTemplateServic
         try {
 
             Object object = parser.parse(new FileReader(jsonPath));
-            // System.out.println("mukesh"+object.toString());
             ModelConfig modelInformation = mapper.readValue(object.toString(), new TypeReference<ModelConfig>() {
             });
 
diff --git a/server/src/test/java/org/onap/usecaseui/server/bean/RelationshipDatumTest.java b/server/src/test/java/org/onap/usecaseui/server/bean/RelationshipDatumTest.java
new file mode 100644 (file)
index 0000000..911db63
--- /dev/null
@@ -0,0 +1,48 @@
+/**
+ * Copyright (C) 2020 Huawei, Inc. and others. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onap.usecaseui.server.bean;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import static org.mockito.Matchers.anyObject;
+
+public class RelationshipDatumTest {
+    @Before
+    public void before() throws Exception {
+    }
+
+    @After
+    public void after() throws Exception {
+    }
+
+    @Test
+    public void testGetRelationshipDatum() throws Exception {
+        RelationshipDatum rd = new RelationshipDatum();
+        rd.getAdditionalProperties();
+        rd.getRelationshipKey();
+        rd.getRelationshipValue();
+    }
+
+    @Test
+    public void testSetRelationshipDatum() throws Exception {
+        RelationshipDatum rd = new RelationshipDatum();
+        rd.setAdditionalProperty("", anyObject());
+        rd.setRelationshipKey("");
+        rd.setRelationshipValue("");
+    }
+}
diff --git a/server/src/test/java/org/onap/usecaseui/server/bean/activeEdge/ComplexObjTest.java b/server/src/test/java/org/onap/usecaseui/server/bean/activeEdge/ComplexObjTest.java
new file mode 100644 (file)
index 0000000..533b98f
--- /dev/null
@@ -0,0 +1,69 @@
+/**
+ * Copyright (C) 2020 Huawei, Inc. and others. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onap.usecaseui.server.bean.activeEdge;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.onap.usecaseui.server.bean.activateEdge.ComplexObj;
+import org.onap.usecaseui.server.bean.activateEdge.RelationshipList;
+
+import static org.mockito.Matchers.anyObject;
+
+public class ComplexObjTest {
+    RelationshipList relationshipList;
+    @Before
+    public void before() throws Exception {
+    }
+
+    @After
+    public void after() throws Exception {
+    }
+
+    @Test
+    public void testGetComplexObj() throws Exception {
+        ComplexObj co = new ComplexObj();
+        co.getCity();
+        co.getPostalCode();
+        co.getAdditionalProperties();
+        co.getCountry();
+        co.getLatitude();
+        co.getLongitude();
+        co.getPhysicalLocationId();
+        co.getPhysicalLocationType();
+        co.getRegion();
+        co.getRelationshipList();
+        co.getResourceVersion();
+        co.getStreet1();
+    }
+
+    @Test
+    public void testSetComplexObj() throws Exception {
+        ComplexObj co = new ComplexObj();
+        co.setCity("");
+        co.setPostalCode("");
+        co.setAdditionalProperty("", anyObject());
+        co.setCountry("");
+        co.setLatitude("");
+        co.setLongitude("");
+        co.setPhysicalLocationId("");
+        co.setPhysicalLocationType("");
+        co.setRegion("");
+        co.setRelationshipList(relationshipList);
+        co.setResourceVersion("");
+        co.setStreet1("");
+    }
+}
diff --git a/server/src/test/java/org/onap/usecaseui/server/bean/activeEdge/RelationshipDatumTest.java b/server/src/test/java/org/onap/usecaseui/server/bean/activeEdge/RelationshipDatumTest.java
new file mode 100644 (file)
index 0000000..38d4941
--- /dev/null
@@ -0,0 +1,49 @@
+/**
+ * Copyright (C) 2020 Huawei, Inc. and others. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onap.usecaseui.server.bean.activeEdge;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.onap.usecaseui.server.bean.activateEdge.RelationshipDatum;
+
+import static org.mockito.Matchers.anyObject;
+
+public class RelationshipDatumTest {
+    @Before
+    public void before() throws Exception {
+    }
+
+    @After
+    public void after() throws Exception {
+    }
+
+    @Test
+    public void testGetRelationshipDatumTest() throws Exception {
+        RelationshipDatum rd = new RelationshipDatum();
+        rd.getAdditionalProperties();
+        rd.getRelationshipKey();
+        rd.getRelationshipValue();
+    }
+
+    @Test
+    public void testSetRelationshipDatumTest() throws Exception {
+        RelationshipDatum rd = new RelationshipDatum();
+        rd.setAdditionalProperty("", anyObject());
+        rd.setRelationshipKey("");
+        rd.setRelationshipValue("");
+    }
+}
diff --git a/server/src/test/java/org/onap/usecaseui/server/bean/activeEdge/RelationshipListTest.java b/server/src/test/java/org/onap/usecaseui/server/bean/activeEdge/RelationshipListTest.java
new file mode 100644 (file)
index 0000000..0235a46
--- /dev/null
@@ -0,0 +1,52 @@
+/**
+ * Copyright (C) 2020 Huawei, Inc. and others. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onap.usecaseui.server.bean.activeEdge;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.onap.usecaseui.server.bean.activateEdge.RelationshipList;
+import org.onap.usecaseui.server.service.lcm.domain.aai.bean.Relationship;
+
+import java.lang.reflect.Array;
+import java.util.List;
+
+import static org.mockito.Matchers.anyObject;
+
+public class RelationshipListTest {
+
+    @Before
+    public void before() throws Exception {
+    }
+
+    @After
+    public void after() throws Exception {
+    }
+
+    @Test
+    public void testGetRelationshipList() throws Exception {
+        RelationshipList rl = new RelationshipList();
+        rl.getRelationship();
+        rl.getAdditionalProperties();
+    }
+
+    @Test
+    public void testSetRelationshipList() throws Exception {
+        RelationshipList rl = new RelationshipList();
+        rl.setRelationship(null);
+        rl.setAdditionalProperty("", anyObject());
+    }
+}
diff --git a/server/src/test/java/org/onap/usecaseui/server/bean/activeEdge/ServiceInstanceTest.java b/server/src/test/java/org/onap/usecaseui/server/bean/activeEdge/ServiceInstanceTest.java
new file mode 100644 (file)
index 0000000..17bebab
--- /dev/null
@@ -0,0 +1,64 @@
+/**
+ * Copyright (C) 2020 Huawei, Inc. and others. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onap.usecaseui.server.bean.activeEdge;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.onap.usecaseui.server.bean.activateEdge.ServiceInstance;
+
+import static org.mockito.Matchers.anyObject;
+
+public class ServiceInstanceTest {
+    @Before
+    public void before() throws Exception {
+    }
+
+    @After
+    public void after() throws Exception {
+    }
+
+    @Test
+    public void testGetServiceInstance() throws Exception {
+        ServiceInstance si = new ServiceInstance();
+        si.getRelationshipList();
+        si.getInputparameters();
+        si.getServiceInstanceName();
+        si.getServiceInstanceId();
+        si.getAdditionalProperties();
+        si.getOrchestrationstatus();
+        si.getResourceVersion();
+        si.getSelflink();
+        si.getServiceRole();
+        si.getServiceType();
+    }
+
+    @Test
+    public void testSetServiceInstance() throws Exception {
+        ServiceInstance si = new ServiceInstance();
+        si.setRelationshipList(null);
+        si.setInputparameters("");
+        si.setServiceInstanceName("");
+        si.setServiceInstanceId("");
+        si.setAdditionalProperty("", anyObject());
+        si.setOrchestrationstatus("");
+        si.setResourceVersion("");
+        si.setSelflink("");
+        si.setServiceRole("");
+        si.setServiceType("");
+    }
+
+}
diff --git a/server/src/test/java/org/onap/usecaseui/server/bean/activeEdge/SiteResourceTest.java b/server/src/test/java/org/onap/usecaseui/server/bean/activeEdge/SiteResourceTest.java
new file mode 100644 (file)
index 0000000..0680dc1
--- /dev/null
@@ -0,0 +1,67 @@
+/**
+ * Copyright (C) 2020 Huawei, Inc. and others. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onap.usecaseui.server.bean.activeEdge;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.onap.usecaseui.server.bean.activateEdge.SiteResource;
+
+import static org.mockito.Matchers.anyObject;
+
+public class SiteResourceTest {
+    @Before
+    public void before() throws Exception {
+    }
+
+    @After
+    public void after() throws Exception {
+    }
+
+    @Test
+    public void testGetSiteResource() throws Exception {
+        SiteResource sr = new SiteResource();
+        sr.getDescription();
+        sr.getRelationshipList();
+        sr.getSiteResourceId();
+        sr.getSiteResourceName();
+        sr.getAdditionalProperties();
+        sr.getCity();
+        sr.getOperationalStatus();
+        sr.getPostalcode();
+        sr.getResourceVersion();
+        sr.getRole();
+        sr.getSelflink();
+        sr.getType();
+    }
+
+    @Test
+    public void testSetSiteResource() throws Exception {
+        SiteResource sr = new SiteResource();
+        sr.setDescription("");
+        sr.setRelationshipList(null);
+        sr.setSiteResourceId("");
+        sr.setSiteResourceName("");
+        sr.setAdditionalProperty("", anyObject());
+        sr.setCity("");
+        sr.setOperationalStatus("");
+        sr.setPostalcode("");
+        sr.setResourceVersion("");
+        sr.setRole("");
+        sr.setSelflink("");
+        sr.setType("");
+    }
+}
diff --git a/server/src/test/java/org/onap/usecaseui/server/bean/customer/ServiceInstanceTest.java b/server/src/test/java/org/onap/usecaseui/server/bean/customer/ServiceInstanceTest.java
new file mode 100644 (file)
index 0000000..672cb4e
--- /dev/null
@@ -0,0 +1,64 @@
+/**
+ * Copyright (C) 2020 Huawei, Inc. and others. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onap.usecaseui.server.bean.customer;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.onap.usecaseui.server.bean.activateEdge.ServiceInstance;
+
+import static org.mockito.Matchers.anyObject;
+
+public class ServiceInstanceTest {
+
+    @Before
+    public void before() throws Exception {
+    }
+
+    @After
+    public void after() throws Exception {
+    }
+
+    @Test
+    public void testGetServiceInstance() throws Exception {
+        org.onap.usecaseui.server.bean.activateEdge.ServiceInstance si = new org.onap.usecaseui.server.bean.activateEdge.ServiceInstance();
+        si.getRelationshipList();
+        si.getInputparameters();
+        si.getServiceInstanceName();
+        si.getServiceInstanceId();
+        si.getAdditionalProperties();
+        si.getOrchestrationstatus();
+        si.getResourceVersion();
+        si.getSelflink();
+        si.getServiceRole();
+        si.getServiceType();
+    }
+
+    @Test
+    public void testSetServiceInstance() throws Exception {
+        org.onap.usecaseui.server.bean.activateEdge.ServiceInstance si = new ServiceInstance();
+        si.setRelationshipList(null);
+        si.setInputparameters("");
+        si.setServiceInstanceName("");
+        si.setServiceInstanceId("");
+        si.setAdditionalProperty("", anyObject());
+        si.setOrchestrationstatus("");
+        si.setResourceVersion("");
+        si.setSelflink("");
+        si.setServiceRole("");
+        si.setServiceType("");
+    }
+}
diff --git a/server/src/test/java/org/onap/usecaseui/server/bean/customer/ServiceInstancesTest.java b/server/src/test/java/org/onap/usecaseui/server/bean/customer/ServiceInstancesTest.java
new file mode 100644 (file)
index 0000000..28a9480
--- /dev/null
@@ -0,0 +1,42 @@
+/**
+ * Copyright (C) 2020 Huawei, Inc. and others. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onap.usecaseui.server.bean.customer;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+public class ServiceInstancesTest {
+    @Before
+    public void before() throws Exception {
+    }
+
+    @After
+    public void after() throws Exception {
+    }
+
+    @Test
+    public void testGetServiceInstances() throws Exception {
+        ServiceInstances si = new ServiceInstances();
+        si.getServiceInstances();
+    }
+
+    @Test
+    public void testSetServiceInstances() throws Exception {
+        ServiceInstances si = new ServiceInstances();
+        si.setServiceInstances(null);
+    }
+}
diff --git a/server/src/test/java/org/onap/usecaseui/server/bean/customer/SubscriptionTest.java b/server/src/test/java/org/onap/usecaseui/server/bean/customer/SubscriptionTest.java
new file mode 100644 (file)
index 0000000..b366276
--- /dev/null
@@ -0,0 +1,46 @@
+/**
+ * Copyright (C) 2020 Huawei, Inc. and others. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onap.usecaseui.server.bean.customer;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+public class SubscriptionTest {
+    @Before
+    public void before() throws Exception {
+    }
+
+    @After
+    public void after() throws Exception {
+    }
+
+    @Test
+    public void testGetSubscripion() throws Exception {
+        Subscription sc = new Subscription();
+        sc.getAccountId();
+        sc.getResourceVersion();
+        sc.getServiceType();
+    }
+
+    @Test
+    public void testSetSubscripion() throws Exception {
+        Subscription sc = new Subscription();
+        sc.setAccountId("");
+        sc.setResourceVersion("");
+        sc.setServiceType("");
+    }
+}
diff --git a/server/src/test/java/org/onap/usecaseui/server/bean/customer/SubscriptionTypeTest.java b/server/src/test/java/org/onap/usecaseui/server/bean/customer/SubscriptionTypeTest.java
new file mode 100644 (file)
index 0000000..6cc2a8c
--- /dev/null
@@ -0,0 +1,43 @@
+/**
+ * Copyright (C) 2020 Huawei, Inc. and others. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onap.usecaseui.server.bean.customer;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+public class SubscriptionTypeTest {
+
+    @Before
+    public void before() throws Exception {
+    }
+
+    @After
+    public void after() throws Exception {
+    }
+
+    @Test
+    public void testGetSubscriptionType() throws Exception {
+        SubscriptionType st = new SubscriptionType();
+        st.getSubscriptions();
+    }
+
+    @Test
+    public void testSetSubscriptionType() throws Exception {
+        SubscriptionType st = new SubscriptionType();
+        st.setSubscriptions(null);
+    }
+}
diff --git a/server/src/test/java/org/onap/usecaseui/server/bean/orderservice/ServiceEstimationTest.java b/server/src/test/java/org/onap/usecaseui/server/bean/orderservice/ServiceEstimationTest.java
new file mode 100644 (file)
index 0000000..39d2fed
--- /dev/null
@@ -0,0 +1,56 @@
+/**
+ * Copyright (C) 2020 Huawei, Inc. and others. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onap.usecaseui.server.bean.orderservice;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.util.List;
+
+public class ServiceEstimationTest {
+    @Before
+    public void before() throws Exception {
+    }
+
+    @After
+    public void after() throws Exception {
+    }
+
+    @Test
+    public void testGetServiceEstimation() throws Exception {
+        ServiceEstimationBean seb = new ServiceEstimationBean();
+        seb.getBandWidth();
+        seb.getBandwidthCost();
+        seb.getCameraCost();
+        seb.getServiceCost();
+        seb.getVpnCost();
+        seb.getVpnInformations();
+        seb.getWlanAccess();
+    }
+
+    @Test
+    public void testSetServiceEstimation() throws Exception {
+        ServiceEstimationBean seb = new ServiceEstimationBean();
+        seb.setBandWidth("");
+        seb.setBandwidthCost("");
+        seb.setCameraCost("");
+        seb.setServiceCost("");
+        seb.setVpnCost("");
+        seb.setVpnInformations(null);
+        seb.setWlanAccess(null);
+    }
+}
diff --git a/server/src/test/java/org/onap/usecaseui/server/bean/orderservice/SiteTest.java b/server/src/test/java/org/onap/usecaseui/server/bean/orderservice/SiteTest.java
new file mode 100644 (file)
index 0000000..6030808
--- /dev/null
@@ -0,0 +1,70 @@
+/**
+ * Copyright (C) 2020 Huawei, Inc. and others. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onap.usecaseui.server.bean.orderservice;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+public class SiteTest {
+    @Before
+    public void before() throws Exception {
+    }
+
+    @After
+    public void after() throws Exception {
+    }
+
+    @Test
+    public void testGetSite() throws Exception {
+        Site site = new Site();
+        site.getAddress();
+        site.getCapacity();
+        site.getDescription();
+        site.getEmail();
+        site.getIsCloudSite();
+        site.getLocation();
+        site.getPrice();
+        site.getRole();
+        site.getSiteId();
+        site.getSiteinterface();
+        site.getSiteName();
+        site.getSiteStatus();
+        site.getSubnet();
+        site.getType();
+        site.getZipCode();
+    }
+
+    @Test
+    public void testSetSite() throws Exception {
+        Site site = new Site();
+        site.setAddress("");
+        site.setCapacity("");
+        site.setDescription("");
+        site.setEmail("");
+        site.setIsCloudSite("");
+        site.setLocation("");
+        site.setPrice("");
+        site.setRole("");
+        site.setSiteId("");
+        site.setSiteinterface("");
+        site.setSiteName("");
+        site.setSiteStatus("");
+        site.setSubnet("");
+        site.setType("");
+        site.setZipCode("");
+    }
+}
diff --git a/server/src/test/java/org/onap/usecaseui/server/bean/orderservice/VpnInformationTest.java b/server/src/test/java/org/onap/usecaseui/server/bean/orderservice/VpnInformationTest.java
new file mode 100644 (file)
index 0000000..76eef6a
--- /dev/null
@@ -0,0 +1,57 @@
+/**
+ * Copyright (C) 2020 Huawei, Inc. and others. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onap.usecaseui.server.bean.orderservice;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+public class VpnInformationTest {
+
+    @Before
+    public void before() throws Exception {
+    }
+
+    @After
+    public void after() throws Exception {
+    }
+
+    @Test
+    public void testGetVpnInformation() throws Exception {
+        VpnInformation vpn = new VpnInformation();
+        vpn.getCameras();
+        vpn.getCost();
+        vpn.getSites();
+        vpn.getVpnBandwidth();
+        vpn.getVpnId();
+        vpn.getVpnName();
+        vpn.getVpnThreshold();
+        vpn.getVpnType();
+    }
+
+    @Test
+    public void testSetVpnInformation() throws Exception {
+        VpnInformation vpn = new VpnInformation();
+        vpn.setCameras("");
+        vpn.setCost("");
+        vpn.setSites(null);
+        vpn.setVpnBandwidth("");
+        vpn.setVpnId("");
+        vpn.setVpnName("");
+        vpn.setVpnThreshold("");
+        vpn.setVpnType("");
+    }
+}
diff --git a/server/src/test/java/org/onap/usecaseui/server/service/lcm/impl/SotnServiceQryServiceImplTest.java b/server/src/test/java/org/onap/usecaseui/server/service/lcm/impl/SotnServiceQryServiceImplTest.java
new file mode 100644 (file)
index 0000000..3731ce0
--- /dev/null
@@ -0,0 +1,47 @@
+/**
+ * Copyright (C) 2020 Huawei, Inc. and others. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onap.usecaseui.server.service.lcm.impl;
+
+import okhttp3.ResponseBody;
+import org.junit.Test;
+import org.onap.usecaseui.server.service.lcm.domain.aai.AAIService;
+
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+import static org.onap.usecaseui.server.util.CallStub.failedCall;
+import static org.onap.usecaseui.server.util.CallStub.successfulCall;
+
+public class SotnServiceQryServiceImplTest {
+
+    AAIService aaiService = mock(AAIService.class);
+
+    SotnServiceQryServiceImpl sotnServiceQryService = new SotnServiceQryServiceImpl(aaiService);
+
+    @Test
+    public void getServiceInstancesTest() {
+        ResponseBody result=null;
+        when(aaiService.listServiceInstances("ISAAC","SOTN")).thenReturn(successfulCall(result));
+        sotnServiceQryService.getServiceInstances("SOTN");
+    }
+
+    @Test
+    public void getServiceInstancesWithThrowException() {
+        ResponseBody result=null;
+        when(aaiService.listServiceInstances("ISAAC","SOTN")).thenReturn(failedCall("aai is not exist!"));
+        sotnServiceQryService.getServiceInstances("SOTN");
+    }
+
+}
diff --git a/server/src/test/java/org/onap/usecaseui/server/service/lcm/impl/SotnServiceTemplateServiceImplTest.java b/server/src/test/java/org/onap/usecaseui/server/service/lcm/impl/SotnServiceTemplateServiceImplTest.java
new file mode 100644 (file)
index 0000000..defec3e
--- /dev/null
@@ -0,0 +1,139 @@
+/**
+ * Copyright (C) 2020 Huawei, Inc. and others. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onap.usecaseui.server.service.lcm.impl;
+
+import okhttp3.ResponseBody;
+import org.junit.Before;
+import org.junit.Test;
+import org.onap.usecaseui.server.bean.lcm.sotne2eservice.E2EServiceInstanceRequest;
+import org.onap.usecaseui.server.bean.lcm.sotne2eservice.ModelConfig;
+import org.onap.usecaseui.server.service.lcm.SotnServiceTemplateService;
+import org.onap.usecaseui.server.service.lcm.domain.aai.AAIService;
+import org.onap.usecaseui.server.service.lcm.domain.so.SOService;
+import org.onap.usecaseui.server.service.lcm.domain.so.bean.ServiceOperation;
+import org.onap.usecaseui.server.service.sotn.impl.SOTNServiceImpl;
+
+import java.util.HashMap;
+
+import static org.mockito.Matchers.anyObject;
+import static org.mockito.Matchers.eq;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+import static org.onap.usecaseui.server.util.CallStub.failedCall;
+import static org.onap.usecaseui.server.util.CallStub.successfulCall;
+
+public class SotnServiceTemplateServiceImplTest {
+
+    AAIService aaiService;
+    SOService soService;
+    ServiceOperation serviceOperation;
+    SotnServiceTemplateServiceImpl sotnServiceTemplateService;
+    @Before
+    public void before() throws Exception {
+        aaiService = mock(AAIService.class);
+        soService = mock(SOService.class);
+        sotnServiceTemplateService = new SotnServiceTemplateServiceImpl();
+    }
+
+    @Test
+    public void instantiate_CCVPN_ServiceTest() {
+        when(soService.instantiateSOTNService(new E2EServiceInstanceRequest())).thenReturn(successfulCall(serviceOperation));
+        sotnServiceTemplateService.instantiate_CCVPN_Service(new HashMap<String, Object>());
+    }
+
+    @Test
+    public void instantiate_CCVPN_ServiceWithThrowException() {
+        when(soService.instantiateSOTNService(new E2EServiceInstanceRequest())).thenReturn(failedCall("failed to create Service"));
+        sotnServiceTemplateService.instantiate_CCVPN_Service(new HashMap<String, Object>());
+    }
+
+    @Test
+    public void createSotnServiceTest() {
+        when(soService.instantiateSOTNService(new E2EServiceInstanceRequest())).thenReturn(successfulCall(serviceOperation));
+        sotnServiceTemplateService.createSotnService(new E2EServiceInstanceRequest());
+    }
+
+    @Test
+    public void createSotnServiceWithThrowException() {
+        when(soService.instantiateSOTNService(new E2EServiceInstanceRequest())).thenReturn(failedCall("failed to create Service"));
+        sotnServiceTemplateService.createSotnService(new E2EServiceInstanceRequest());
+    }
+
+    @Test
+    public void getServiceInstancesInfoTest() throws Exception {
+        ResponseBody result=null;
+        when(aaiService.getServiceInstancesForEdge("ISAAC","SOTN","ISAAC")).thenReturn(successfulCall(result));
+        sotnServiceTemplateService.getServiceInstancesInfo("ISAAC","SOTN","ISAAC");
+    }
+
+    @Test
+    public void getServiceInstancesInfoWithThrowException() throws Exception {
+        when(aaiService.getServiceInstancesForEdge("ISAAC","SOTN","ISAAC")).thenReturn(failedCall("Failed to get Service Instance"));
+        sotnServiceTemplateService.getServiceInstancesInfo("ISAAC","SOTN","ISAAC");
+    }
+
+    @Test
+    public void getTerminationPointTest() throws Exception {
+        ResponseBody result = null;
+        when(aaiService.getTerminationPoint("SOTN","123")).thenReturn(successfulCall(result));
+        sotnServiceTemplateService.getTerminationPoint("SOTN", "123");
+    }
+
+    @Test
+    public void getTerminationPointWithThrowException() throws Exception {
+        when(aaiService.getTerminationPoint("SOTN","123")).thenReturn(failedCall("Failed to get connectivity information."));
+        sotnServiceTemplateService.getTerminationPoint("SOTN", "123");
+    }
+
+    @Test
+    public void getSOTNPinterfaceByVpnIdTest() throws Exception {
+        ResponseBody result = null;
+        when(aaiService.getPinterfaceByVpnId("1")).thenReturn(successfulCall(result));
+        sotnServiceTemplateService.getSOTNPinterfaceByVpnId("1");
+    }
+
+    @Test
+    public void getSOTNPinterfaceByVpnIdWithThrowException() throws Exception {
+        when(aaiService.getPinterfaceByVpnId("1")).thenReturn(failedCall("failed to get VPN ID"));
+        sotnServiceTemplateService.getSOTNPinterfaceByVpnId("1");
+    }
+
+    @Test
+    public void getSOTNPnfTest() throws Exception {
+        ResponseBody result = null;
+        when(aaiService.getPnfInfo("test")).thenReturn(successfulCall(result));
+        sotnServiceTemplateService.getSOTNPnf("test");
+    }
+
+    @Test
+    public void getSOTNPnfWithThrowException() throws Exception {
+        when(aaiService.getPnfInfo("test")).thenReturn(failedCall("Failed to get PNF info."));
+        sotnServiceTemplateService.getSOTNPnf("test");
+    }
+
+    @Test
+    public void getSOTNLinkbyNameTest() throws Exception {
+        ResponseBody result = null;
+        when(aaiService.getSpecificLogicalLink("link")).thenReturn(successfulCall(result));
+        sotnServiceTemplateService.getSOTNLinkbyName("link");
+    }
+
+    @Test
+    public void getSOTNLinkbyNameWithThrowException() throws Exception {
+        when(aaiService.getSpecificLogicalLink("link")).thenReturn(failedCall("Failed to get link info."));
+        sotnServiceTemplateService.getSOTNLinkbyName("link");
+    }
+}