diff options
44 files changed, 2236 insertions, 5 deletions
diff --git a/server/src/main/java/org/onap/usecaseui/server/service/lcm/impl/SotnServiceTemplateServiceImpl.java b/server/src/main/java/org/onap/usecaseui/server/service/lcm/impl/SotnServiceTemplateServiceImpl.java index d08a135f..1e3411c6 100644 --- a/server/src/main/java/org/onap/usecaseui/server/service/lcm/impl/SotnServiceTemplateServiceImpl.java +++ b/server/src/main/java/org/onap/usecaseui/server/service/lcm/impl/SotnServiceTemplateServiceImpl.java @@ -80,7 +80,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>() { }); @@ -101,7 +100,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 index 00000000..911db63d --- /dev/null +++ b/server/src/test/java/org/onap/usecaseui/server/bean/RelationshipDatumTest.java @@ -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 index 00000000..e6e1901e --- /dev/null +++ b/server/src/test/java/org/onap/usecaseui/server/bean/activeEdge/ComplexObjTest.java @@ -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.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(); + co.toString(); + } + + @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 index 00000000..ee2e6d0e --- /dev/null +++ b/server/src/test/java/org/onap/usecaseui/server/bean/activeEdge/RelationshipDatumTest.java @@ -0,0 +1,50 @@ +/** + * 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(); + rd.toString(); + } + + @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 index 00000000..946b7dbe --- /dev/null +++ b/server/src/test/java/org/onap/usecaseui/server/bean/activeEdge/RelationshipListTest.java @@ -0,0 +1,53 @@ +/** + * 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(); + rl.toString(); + } + + @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 index 00000000..17bebabe --- /dev/null +++ b/server/src/test/java/org/onap/usecaseui/server/bean/activeEdge/ServiceInstanceTest.java @@ -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 index 00000000..fb0a31da --- /dev/null +++ b/server/src/test/java/org/onap/usecaseui/server/bean/activeEdge/SiteResourceTest.java @@ -0,0 +1,68 @@ +/** + * 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(); + sr.toString(); + } + + @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 index 00000000..9ac30cc0 --- /dev/null +++ b/server/src/test/java/org/onap/usecaseui/server/bean/customer/ServiceInstanceTest.java @@ -0,0 +1,60 @@ +/** + * 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 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.getServiceInstanceName(); + si.getServiceInstanceId(); + si.getAdditionalProperties(); + si.getResourceVersion(); + si.getSelflink(); + si.getServiceRole(); + si.getServiceType(); + si.toString(); + } + + @Test + public void testSetServiceInstance() throws Exception { + ServiceInstance si = new ServiceInstance(); + si.setRelationshipList(null); + si.setServiceInstanceName(""); + si.setServiceInstanceId(""); + si.setAdditionalProperty("", anyObject()); + 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 index 00000000..bc3c0e7c --- /dev/null +++ b/server/src/test/java/org/onap/usecaseui/server/bean/customer/ServiceInstancesTest.java @@ -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 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(); + si.toString(); + } + + @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 index 00000000..88fb24e5 --- /dev/null +++ b/server/src/test/java/org/onap/usecaseui/server/bean/customer/SubscriptionTest.java @@ -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.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(); + sc.toString(); + } + + @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 index 00000000..81621540 --- /dev/null +++ b/server/src/test/java/org/onap/usecaseui/server/bean/customer/SubscriptionTypeTest.java @@ -0,0 +1,44 @@ +/** + * 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(); + st.toString(); + } + + @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/lcm/sotne2eservice/AllottedResourceTest.java b/server/src/test/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/AllottedResourceTest.java new file mode 100644 index 00000000..106d2fc0 --- /dev/null +++ b/server/src/test/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/AllottedResourceTest.java @@ -0,0 +1,72 @@ +/** + * 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.lcm.sotne2eservice; + +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +import static org.mockito.Matchers.anyObject; + +public class AllottedResourceTest { + @Before + public void before() throws Exception { + } + + @After + public void after() throws Exception { + } + @Test + public void testGetAllocattedResource() { + AllottedResource ar = new AllottedResource(); + + ar.getAccessClientId(); + ar.getAccessLtpId(); + ar.getAccessNodeId(); + ar.getAccessProviderId(); + ar.getAccessTopologyId(); + ar.getAdditionalProperties(); + ar.getCvlan(); + ar.getId(); + ar.getModelInvariantId(); + ar.getModelVersionId(); + ar.getOperationalStatus(); + ar.getRelationshipList(); + ar.getResourceVersion(); + ar.getSelflink(); + ar.getVpnName(); + } + @Test + public void testSetAllocattedResource() { + AllottedResource ar = new AllottedResource(); + + ar.setAccessClientId(""); + ar.setAccessLtpId(""); + ar.setAccessNodeId(""); + ar.setAccessProviderId(""); + ar.setAccessTopologyId(""); + ar.setAdditionalProperty("", anyObject()); + ar.setCvlan(""); + ar.setId(""); + ar.setModelInvariantId(""); + ar.setModelVersionId(""); + ar.setOperationalStatus(""); + ar.setRelationshipList(null); + ar.setResourceVersion(""); + ar.setSelflink(""); + ar.setVpnName(""); + } +} diff --git a/server/src/test/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/ConnectivityTest.java b/server/src/test/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/ConnectivityTest.java new file mode 100644 index 00000000..02193720 --- /dev/null +++ b/server/src/test/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/ConnectivityTest.java @@ -0,0 +1,89 @@ +/** + * 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.lcm.sotne2eservice; + +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +import static org.mockito.Matchers.anyObject; + +public class ConnectivityTest { + @Before + public void before() throws Exception { + } + + @After + public void after() throws Exception { + } + @Test + public void testGetConnectivityTest() throws Exception{ + Connectivity c = new Connectivity(); + c.getConnectivityId(); + c.getAccessClientId(); + c.getAccessLtpId(); + c.getAccessNodeId(); + c.getAccessProviderId(); + c.getAccessTopologyId(); + c.getAdditionalProperties(); + c.getBandwidthProfileName(); + c.getCbs(); + c.getCir(); + c.getColorAware(); + c.getConnectivitySelflink(); + c.getEbs(); + c.getEir(); + c.getRelationshipList(); + c.getResourceVersion(); + c.getEthtSvcName(); + c.getOperationalStatus(); + c.getAdditionalProperties(); + c.getCouplingFlag(); + c.getModelCustomizationId(); + c.getModelInvariantId(); + c.getModelVersionId(); + c.toString(); + + } + @Test + public void testSetConnectivityTest() throws Exception{ + Connectivity c = new Connectivity(); + c.setAccessClientId(""); + c.setAccessLtpId(""); + c.setAccessNodeId(""); + c.setAccessProviderId(""); + c.setAccessTopologyId(""); + c.setAdditionalProperty("",anyObject()); + c.setBandwidthProfileName(""); + c.setCbs(""); + c.setColorAware(""); + c.setConnectivityId(""); + c.setConnectivitySelflink(""); + c.setCouplingFlag(""); + c.setEbs(""); + c.setEthtSvcName(""); + c.setEir(""); + c.setCir(""); + c.setModelCustomizationId(""); + c.setModelInvariantId(""); + c.setResourceVersion(""); + c.setOperationalStatus(""); + c.setRelationshipList(null); + c.setModelVersionId(""); + + + } +} diff --git a/server/src/test/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/E2EParametersTest.java b/server/src/test/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/E2EParametersTest.java new file mode 100644 index 00000000..2333c426 --- /dev/null +++ b/server/src/test/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/E2EParametersTest.java @@ -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.lcm.sotne2eservice; + +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +public class E2EParametersTest { + @Before + public void before() throws Exception { + } + + @After + public void after() throws Exception { + } + @Test + public void testGetE2EParameters() throws Exception{ + E2EParameters e2epr = new E2EParameters(); + e2epr.getAdditionalProperties(); + e2epr.getRequestInputs(); + e2epr.getResources(); + } + @Test + public void testSetE2EParameters() throws Exception{ + E2EParameters e2epr = new E2EParameters(); + e2epr.setAdditionalProperties(null); + e2epr.setRequestInputs(null); + e2epr.setResources(null); + + } +} + + diff --git a/server/src/test/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/E2EServiceDeleteTest.java b/server/src/test/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/E2EServiceDeleteTest.java new file mode 100644 index 00000000..726992f4 --- /dev/null +++ b/server/src/test/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/E2EServiceDeleteTest.java @@ -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.lcm.sotne2eservice; + +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +import static org.mockito.Matchers.anyObject; + +public class E2EServiceDeleteTest { + @Before + public void before() throws Exception { + } + + @After + public void after() throws Exception { + } + @Test + public void testGetE2EServiceDelete() throws Exception{ + E2EServiceDelete e2esd = new E2EServiceDelete(); + e2esd.getAdditionalProperties(); + e2esd.getGlobalSubscriberId(); + e2esd.getServiceType(); + e2esd.toString(); + } + @Test + public void testSetE2EServiceDelete() throws Exception{ + E2EServiceDelete e2esd = new E2EServiceDelete(); + e2esd.setAdditionalProperty("", anyObject()); + e2esd.setGlobalSubscriberId(""); + e2esd.setServiceType(""); + } +} diff --git a/server/src/test/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/E2EServiceInstanceRequestTest.java b/server/src/test/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/E2EServiceInstanceRequestTest.java new file mode 100644 index 00000000..b3963330 --- /dev/null +++ b/server/src/test/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/E2EServiceInstanceRequestTest.java @@ -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.bean.lcm.sotne2eservice; + +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +import static org.mockito.Matchers.any; +import static org.mockito.Matchers.anyObject; + +public class E2EServiceInstanceRequestTest { + @Before + public void before() throws Exception { + } + + @After + public void after() throws Exception { + } + @Test + public void testGetE2EServiceInstanceRequest() throws Exception{ + E2EServiceInstanceRequest e2esir = new E2EServiceInstanceRequest(); + e2esir.getAdditionalProperties(); + e2esir.getService(); + + } + @Test + public void testSetE2EServiceInstanceRequest() throws Exception{ + E2EServiceInstanceRequest e2esir = new E2EServiceInstanceRequest(); + e2esir.setAdditionalProperty("",anyObject()); + e2esir.setAdditionalProperties(null); + e2esir.setService(any()); + } +} diff --git a/server/src/test/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/E2EServiceTest.java b/server/src/test/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/E2EServiceTest.java new file mode 100644 index 00000000..2117b66f --- /dev/null +++ b/server/src/test/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/E2EServiceTest.java @@ -0,0 +1,55 @@ +/** + * 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.lcm.sotne2eservice; + +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +public class E2EServiceTest { + @Before + public void before() throws Exception { + } + + @After + public void after() throws Exception { + } + @Test + public void testGetE2EService() throws Exception{ + E2EService e2es = new E2EService(); + e2es.getAdditionalProperties(); + e2es.getDescription(); + e2es.getGlobalSubscriberId(); + e2es.getName(); + e2es.getParameters(); + e2es.getServiceInvariantUuid(); + e2es.getServiceType(); + e2es.getClass(); + e2es.getServiceUuid(); + } + @Test + public void testSetE2EService() throws Exception{ + E2EService e2es = new E2EService(); + e2es.setAdditionalProperties(null); + e2es.setDescription(""); + e2es.setGlobalSubscriberId(""); + e2es.setName(""); + e2es.setParameters(null); + e2es.setServiceInvariantUuid(""); + e2es.setServiceType(""); + e2es.setServiceUuid(""); + } +} diff --git a/server/src/test/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/EdgeTest.java b/server/src/test/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/EdgeTest.java new file mode 100644 index 00000000..e9eb6dfa --- /dev/null +++ b/server/src/test/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/EdgeTest.java @@ -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.lcm.sotne2eservice; + +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +public class EdgeTest { + @Before + public void before() throws Exception { + } + + @After + public void after() throws Exception { + } + @Test + public void testGetEdge() throws Exception{ + Edge edge = new Edge(); + edge.getFrom(); + edge.getTo(); + edge.toString(); + } + @Test + public void testSetEdge() throws Exception{ + Edge edge = new Edge(); + edge.setFrom(""); + edge.setTo(""); + } +} diff --git a/server/src/test/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/FileBeanTest.java b/server/src/test/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/FileBeanTest.java new file mode 100644 index 00000000..9cf8a2ff --- /dev/null +++ b/server/src/test/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/FileBeanTest.java @@ -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.lcm.sotne2eservice; + +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +public class FileBeanTest { + @Before + public void before() throws Exception { + } + + @After + public void after() throws Exception { + } + @Test + public void testGetFileBean() throws Exception{ + FileBean fb = new FileBean(); + fb.getFileName(); + fb.toString(); + } + @Test + public void testSetFileBean() throws Exception{ + FileBean fb = new FileBean(); + fb.setFileName(""); + } + +} diff --git a/server/src/test/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/FileWrapperTest.java b/server/src/test/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/FileWrapperTest.java new file mode 100644 index 00000000..bcc7002d --- /dev/null +++ b/server/src/test/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/FileWrapperTest.java @@ -0,0 +1,45 @@ +/** + * 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.lcm.sotne2eservice; + +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +import static org.mockito.Matchers.any; + +public class FileWrapperTest { + @Before + public void before() throws Exception { + } + + @After + public void after() throws Exception { + } + @Test + public void testGetFileWrapper() throws Exception{ + FileWrapper fw = new FileWrapper(); + fw.getFile(); + fw.toString(); + } + @Test + public void testSetFileWrapper() throws Exception{ + FileWrapper fw = new FileWrapper(); + fw.setFile(any()); + } + +} diff --git a/server/src/test/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/LogicalLinkTest.java b/server/src/test/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/LogicalLinkTest.java new file mode 100644 index 00000000..2861ff2c --- /dev/null +++ b/server/src/test/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/LogicalLinkTest.java @@ -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.lcm.sotne2eservice; + +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +import static org.mockito.Matchers.any; +import static org.mockito.Matchers.anyObject; + +public class LogicalLinkTest { + @Before + public void before() throws Exception { + } + + @After + public void after() throws Exception { + } + @Test + public void testGetlogicalLink() throws Exception{ + LogicalLink Ll = new LogicalLink(); + Ll.getAdditionalProperties(); + Ll.getInMaint(); + Ll.getLinkName(); + Ll.getLinkType(); + Ll.getOperationalStatus(); + Ll.getRelationshipList(); + Ll.getResourceVersion(); + } + @Test + public void testSetlogicalLink() throws Exception{ + LogicalLink Ll = new LogicalLink(); + Ll.setAdditionalProperty("", anyObject()); + Ll.setInMaint(true); + Ll.setLinkName(""); + Ll.setLinkType(""); + Ll.setOperationalStatus(""); + Ll.setResourceVersion(""); + Ll.setRelationshipList(any()); + } + +} diff --git a/server/src/test/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/ModelConfigTest.java b/server/src/test/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/ModelConfigTest.java new file mode 100644 index 00000000..a8761d63 --- /dev/null +++ b/server/src/test/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/ModelConfigTest.java @@ -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.lcm.sotne2eservice; + +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +import java.util.List; + +public class ModelConfigTest { + @Before + public void before() throws Exception { + } + + @After + public void after() throws Exception { + } + + @Test + public void testGetModelConfig() throws Exception { + ModelConfig mc = new ModelConfig(); + mc.getSubscriberId(); + mc.getResourcemodelinformation(); + mc.getServiceModel(); + mc.getSubscriptionType(); + mc.getCreateSleepTime(); + mc.getDeleteSleepTime(); + mc.getStatus(); + } + + @Test + public void testSetModelConfig() throws Exception { + ModelConfig mc = new ModelConfig(); + ModelInfor mi = new ModelInfor(); + mc.setSubscriberId(""); + mc.setResourcemodelinformation(null); + mc.setServiceModel(mi); + mc.setSubscriptionType(""); + mc.setCreateSleepTime(""); + mc.setDeleteSleepTime(""); + mc.setStatus(""); + } +} diff --git a/server/src/test/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/ModelInforTest.java b/server/src/test/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/ModelInforTest.java new file mode 100644 index 00000000..97cb5cfc --- /dev/null +++ b/server/src/test/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/ModelInforTest.java @@ -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.lcm.sotne2eservice; + +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +public class ModelInforTest { + + @Before + public void before() throws Exception { + } + + @After + public void after() throws Exception { + } + + @Test + public void testGetModelInfor() throws Exception { + ModelInfor mi = new ModelInfor(); + mi.getModel(); + mi.getModelType(); + } + + @Test + public void testSetModelInfor() throws Exception { + ModelInfor mi = new ModelInfor(); + Model model = new Model(); + mi.setModel(model); + mi.setModelType(""); + } +} diff --git a/server/src/test/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/ModelTest.java b/server/src/test/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/ModelTest.java new file mode 100644 index 00000000..f540d7f6 --- /dev/null +++ b/server/src/test/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/ModelTest.java @@ -0,0 +1,50 @@ +/** + * 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.lcm.sotne2eservice; + +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +public class ModelTest { + @Before + public void before() throws Exception { + } + + @After + public void after() throws Exception { + } + + @Test + public void testGetModel() throws Exception { + Model md = new Model(); + md.getResourceInvariantUuid(); + md.getResourceCustomizationUuid(); + md.getResourceName(); + md.getResourceUuid(); + md.getResourceDesc(); + } + + @Test + public void testSetModel() throws Exception { + Model md = new Model(); + md.setResourceCustomizationUuid(""); + md.setResourceDesc(""); + md.setResourceInvariantUuid(""); + md.setResourceName(""); + md.setResourceUuid(""); + } +} diff --git a/server/src/test/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/NodeTest.java b/server/src/test/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/NodeTest.java new file mode 100644 index 00000000..9588842d --- /dev/null +++ b/server/src/test/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/NodeTest.java @@ -0,0 +1,54 @@ +/** + * 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.lcm.sotne2eservice; + +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +public class NodeTest { + + @Before + public void before() throws Exception { + } + + @After + public void after() throws Exception { + } + + @Test + public void testGetNode() throws Exception { + Node node = new Node(); + node.getId(); + node.getColor(); + node.getDataNode(); + node.getImage(); + node.getLabel(); + node.getShape(); + node.toString(); + } + + @Test + public void testSetNode() throws Exception { + Node node = new Node(); + node.setId(""); + node.setColor(""); + node.setDataNode(""); + node.setImage(""); + node.setLabel(""); + node.setShape(""); + } +} diff --git a/server/src/test/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/PinterfaceTest.java b/server/src/test/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/PinterfaceTest.java new file mode 100644 index 00000000..c197e6cd --- /dev/null +++ b/server/src/test/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/PinterfaceTest.java @@ -0,0 +1,58 @@ +/** + * 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.lcm.sotne2eservice; + +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +public class PinterfaceTest { + @Before + public void before() throws Exception { + } + + @After + public void after() throws Exception { + } + + @Test + public void testGetPinterface() throws Exception { + Pinterface pi = new Pinterface(); + pi.getInterfaceName(); + pi.getRelationshipList(); + pi.getOperationalStatus(); + pi.getEquipmentIdentifier(); + pi.getInMaint(); + pi.getNetworkRef(); + pi.getResourceVersion(); + pi.getSpeedValue(); + pi.getTransparent(); + } + + @Test + public void testSetPinterface() throws Exception { + Pinterface pi = new Pinterface(); + pi.setInterfaceName(""); + pi.setRelationshipList(null); + pi.setOperationalStatus(""); + pi.setEquipmentIdentifier(""); + pi.setInMaint(true); + pi.setNetworkRef(""); + pi.setResourceVersion(""); + pi.setSpeedValue(""); + pi.setTransparent(""); + } +} diff --git a/server/src/test/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/PnfTest.java b/server/src/test/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/PnfTest.java new file mode 100644 index 00000000..d011b09e --- /dev/null +++ b/server/src/test/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/PnfTest.java @@ -0,0 +1,58 @@ +/** + * 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.lcm.sotne2eservice; + +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +import static org.mockito.Matchers.anyObject; + +public class PnfTest { + @Before + public void before() throws Exception { + } + + @After + public void after() throws Exception { + } + + @Test + public void testGetPnf() throws Exception { + Pnf pnf = new Pnf(); + pnf.getPnfId(); + pnf.getAdditionalProperties(); + pnf.getAdminStatus(); + pnf.getInMaint(); + pnf.getOperationalStatus(); + pnf.getPnfName(); + pnf.getRelationshipList(); + pnf.getResourceVersion(); + } + + @Test + public void testSetPnf() throws Exception { + Pnf pnf = new Pnf(); + pnf.setPnfId(""); + pnf.setAdditionalProperty("", anyObject()); + pnf.setAdminStatus(""); + pnf.setInMaint(true); + pnf.setOperationalStatus(""); + pnf.setPnfName(""); + pnf.setRelationshipList(null); + pnf.setResourceVersion(""); + } +} diff --git a/server/src/test/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/ResourceRequestTest.java b/server/src/test/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/ResourceRequestTest.java new file mode 100644 index 00000000..d2f55bd4 --- /dev/null +++ b/server/src/test/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/ResourceRequestTest.java @@ -0,0 +1,59 @@ +/** + * 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.lcm.sotne2eservice; + +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +import java.util.HashMap; + +import static org.mockito.Matchers.anyObject; + +public class ResourceRequestTest { + + @Before + public void before() throws Exception { + } + + @After + public void after() throws Exception { + } + + @Test + public void testGetResourceRequest() throws Exception { + ResourceRequest rr = new ResourceRequest(); + rr.getAdditionalProperties(); + rr.getParameters(); + rr.getResourceCustomizationUuid(); + rr.getResourceInvariantUuid(); + rr.getResourceName(); + rr.getResourceUuid(); + } + + @Test + public void testSetResourceRequest() throws Exception { + ResourceRequest rr = new ResourceRequest(); + HashMap<String , Object> hr = new HashMap<String, Object>(); + rr.setAdditionalProperties(hr); + E2EParameters e2EParameters = new E2EParameters(); + rr.setParameters(e2EParameters); + rr.setResourceCustomizationUuid(""); + rr.setResourceInvariantUuid(""); + rr.setResourceName(""); + rr.setResourceUuid(""); + } +} diff --git a/server/src/test/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/ResourceResponseTest.java b/server/src/test/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/ResourceResponseTest.java new file mode 100644 index 00000000..c00b8956 --- /dev/null +++ b/server/src/test/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/ResourceResponseTest.java @@ -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.bean.lcm.sotne2eservice; + +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +import java.util.List; + +public class ResourceResponseTest { + @Before + public void before() throws Exception { + } + + @After + public void after() throws Exception { + } + + @Test + public void testGetResourceResponse() throws Exception { + ResourceResponse rr = new ResourceResponse(); + rr.getEdges(); + rr.getNodes(); + rr.toString(); + } + + @Test + public void testSetResourceResponse() throws Exception { + ResourceResponse rr = new ResourceResponse(); + rr.setEdges(null); + rr.setNodes(null); + } +} diff --git a/server/src/test/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/VpnBindingTest.java b/server/src/test/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/VpnBindingTest.java new file mode 100644 index 00000000..d5533422 --- /dev/null +++ b/server/src/test/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/VpnBindingTest.java @@ -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.lcm.sotne2eservice; + +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +public class VpnBindingTest { + @Before + public void before() throws Exception { + } + + @After + public void after() throws Exception { + } + + @Test + public void testGetVpnBinding() throws Exception { + VpnBinding vb = new VpnBinding(); + vb.getVpnBinding(); + } + + @Test + public void testSetVpnBinding() throws Exception { + VpnBinding vb = new VpnBinding(); + vb.setVpnBinding(null); + } +} diff --git a/server/src/test/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/VpnInformationTest.java b/server/src/test/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/VpnInformationTest.java new file mode 100644 index 00000000..817d21c6 --- /dev/null +++ b/server/src/test/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/VpnInformationTest.java @@ -0,0 +1,71 @@ +/** + * 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.lcm.sotne2eservice; + +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +import static org.mockito.Matchers.anyObject; + +public class VpnInformationTest { + @Before + public void before() throws Exception { + } + + @After + public void after() throws Exception { + } + @Test + public void testGetVpnInformation() throws Exception { + VpnInformation vi = new VpnInformation(); + vi.getDstAccessNodeId(); + vi.getRelationshipList(); + vi.getSrcAccessNodeId(); + vi.getVpnId(); + vi.getAccessClientId(); + vi.getAccessProviderId(); + vi.getAccessTopologyId(); + vi.getAdditionalProperties(); + vi.getDstAccessLtpId(); + vi.getOperationalStatus(); + vi.getResourceVersion(); + vi.getSrcAccessLtpId(); + vi.getVpnName(); + vi.getVpnRegion(); + vi.getVpnType(); + } + + @Test + public void testSetVpnInformation() throws Exception { + VpnInformation vi = new VpnInformation(); + vi.setDstAccessNodeId(""); + vi.setRelationshipList(null); + vi.setSrcAccessNodeId(""); + vi.setVpnId(""); + vi.setAccessClientId(""); + vi.setAccessProviderId(""); + vi.setAccessTopologyId(""); + vi.setAdditionalProperty("", anyObject()); + vi.setDstAccessLtpId(""); + vi.setOperationalStatus(""); + vi.setResourceVersion(""); + vi.setSrcAccessLtpId(""); + vi.setVpnName(""); + vi.setVpnRegion(""); + vi.setVpnType(""); + } +} diff --git a/server/src/test/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/resourcemodelinformationTest.java b/server/src/test/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/resourcemodelinformationTest.java new file mode 100644 index 00000000..c320c1b6 --- /dev/null +++ b/server/src/test/java/org/onap/usecaseui/server/bean/lcm/sotne2eservice/resourcemodelinformationTest.java @@ -0,0 +1,44 @@ +/** + * 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.lcm.sotne2eservice; + +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +public class resourcemodelinformationTest { + + @Before + public void before() throws Exception { + } + + @After + public void after() throws Exception { + } + + @Test + public void testGetresourcemodelinformation() { + resourcemodelinformation rsi = new resourcemodelinformation(); + rsi.getResourceModel(); + } + + @Test + public void testSetresourcemodelinformation() { + resourcemodelinformation rsi = new resourcemodelinformation(); + ModelInfor mi = new ModelInfor(); + rsi.setResourceModel(mi); + } +} diff --git a/server/src/test/java/org/onap/usecaseui/server/bean/lcm/sotne2eservicemonitor/ResponseServiceInstanceWrapperTest.java b/server/src/test/java/org/onap/usecaseui/server/bean/lcm/sotne2eservicemonitor/ResponseServiceInstanceWrapperTest.java new file mode 100644 index 00000000..674c7e73 --- /dev/null +++ b/server/src/test/java/org/onap/usecaseui/server/bean/lcm/sotne2eservicemonitor/ResponseServiceInstanceWrapperTest.java @@ -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.lcm.sotne2eservicemonitor; + +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.onap.usecaseui.server.bean.lcm.TemplateInput; + +import java.util.ArrayList; +import java.util.List; + +public class ResponseServiceInstanceWrapperTest { + @Before + public void before() throws Exception { + } + + @After + public void after() throws Exception { + } + + @Test + public void testGetServiceTemplateInput() throws Exception { + ResponseServiceInstanceWrapper rsi = new ResponseServiceInstanceWrapper(); + rsi.getServiceInstanceListList(); + rsi.toString(); + } + @Test + public void testSetServiceTemplateInput() throws Exception { + ResponseServiceInstanceWrapper rsi = new ResponseServiceInstanceWrapper(); + rsi.setServiceInstanceListList(null); + } +} diff --git a/server/src/test/java/org/onap/usecaseui/server/bean/lcm/sotne2eservicemonitor/ServiceInstanceListTest.java b/server/src/test/java/org/onap/usecaseui/server/bean/lcm/sotne2eservicemonitor/ServiceInstanceListTest.java new file mode 100644 index 00000000..c6731c90 --- /dev/null +++ b/server/src/test/java/org/onap/usecaseui/server/bean/lcm/sotne2eservicemonitor/ServiceInstanceListTest.java @@ -0,0 +1,54 @@ +/** + * 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.lcm.sotne2eservicemonitor; + +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +public class ServiceInstanceListTest { + @Before + public void before() throws Exception { + } + + @After + public void after() throws Exception { + } + + @Test + public void testGetServiceTemplateInput() throws Exception { + ServiceInstanceList sil = new ServiceInstanceList(); + sil.getServiceInstance(); + sil.toString(); + } + @Test + public void testGetServiceInstancename() throws Exception { + ServiceInstanceList sil = new ServiceInstanceList(); + sil.getServiceInstancename(); + } + @Test + public void testSetServiceInstance() throws Exception { + ServiceInstanceList sil = new ServiceInstanceList(); + sil.setServiceInstance(null); + } + @Test + public void testSetServiceInstancename() throws Exception { + ServiceInstanceList sil = new ServiceInstanceList(); + sil.setServiceInstancename(null); + } + + +} diff --git a/server/src/test/java/org/onap/usecaseui/server/bean/lcm/sotne2eservicemonitor/ServiceInstanceListWrapperTest.java b/server/src/test/java/org/onap/usecaseui/server/bean/lcm/sotne2eservicemonitor/ServiceInstanceListWrapperTest.java new file mode 100644 index 00000000..f7a48e31 --- /dev/null +++ b/server/src/test/java/org/onap/usecaseui/server/bean/lcm/sotne2eservicemonitor/ServiceInstanceListWrapperTest.java @@ -0,0 +1,41 @@ +/** + * 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.lcm.sotne2eservicemonitor; + +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +public class ServiceInstanceListWrapperTest { + @Before + public void before() throws Exception { + } + + @After + public void after() throws Exception { + } + @Test + public void testGetServiceIntances() throws Exception { + ServiceInstanceListWrapper siw = new ServiceInstanceListWrapper(); + siw.getServiceIntances(); + } + @Test + public void testSetServiceIntances() throws Exception { + ServiceInstanceListWrapper siw = new ServiceInstanceListWrapper(); + siw.setServiceIntances(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 index 00000000..2d406c49 --- /dev/null +++ b/server/src/test/java/org/onap/usecaseui/server/bean/orderservice/ServiceEstimationTest.java @@ -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; + +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(); + seb.toString(); + } + + @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 index 00000000..7e4f7c7e --- /dev/null +++ b/server/src/test/java/org/onap/usecaseui/server/bean/orderservice/SiteTest.java @@ -0,0 +1,71 @@ +/** + * 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(); + site.toString(); + } + + @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 index 00000000..67c9589f --- /dev/null +++ b/server/src/test/java/org/onap/usecaseui/server/bean/orderservice/VpnInformationTest.java @@ -0,0 +1,58 @@ +/** + * 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(); + vpn.toString(); + } + + @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 index 00000000..3731ce01 --- /dev/null +++ b/server/src/test/java/org/onap/usecaseui/server/service/lcm/impl/SotnServiceQryServiceImplTest.java @@ -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 index 00000000..defec3e7 --- /dev/null +++ b/server/src/test/java/org/onap/usecaseui/server/service/lcm/impl/SotnServiceTemplateServiceImplTest.java @@ -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"); + } +} diff --git a/standalone/src/main/assembly/Dockerfile b/standalone/src/main/assembly/Dockerfile index 0f87b045..30878be3 100644 --- a/standalone/src/main/assembly/Dockerfile +++ b/standalone/src/main/assembly/Dockerfile @@ -49,4 +49,7 @@ RUN mkdir /home/uui WORKDIR /home/uui ADD usecase-ui-server-*-linux64.tar.gz /home/uui/ +RUN bash /home/uui/bin/docker-env-config.sh +USER postgres +WORKDIR /home/uui ENTRYPOINT /home/uui/bin/run.sh diff --git a/standalone/src/main/assembly/bin/docker-env-config.sh b/standalone/src/main/assembly/bin/docker-env-config.sh new file mode 100644 index 00000000..04559ba3 --- /dev/null +++ b/standalone/src/main/assembly/bin/docker-env-config.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# +# Copyright 2020 CMCC Corporation. +# +# 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. +# + +main_path="/home/uui" + +add_user() { + #useradd postgres + echo "add_user postgres..." + chown -R postgres:postgres $main_path +} + +modify_owner() { + dbScript="$main_path/resources/bin/initDB.sh" + chmod 755 $dbScript + chown -R postgres:postgres /var/run/postgresql + chown -R postgres:postgres $PG_HOME + chown -R postgres:postgres $PG_VAR_LIB + chown -R postgres:postgres $PG_USR_LIB + chown -R postgres:postgres $PG_LOGDIR + echo "modify files owner..." +} + +add_user +modify_owner diff --git a/standalone/src/main/assembly/bin/run.sh b/standalone/src/main/assembly/bin/run.sh index a80b0b01..bb0789b9 100644 --- a/standalone/src/main/assembly/bin/run.sh +++ b/standalone/src/main/assembly/bin/run.sh @@ -24,7 +24,6 @@ sleep 10 echo "usecase-ui database init script start..." dbScript="$main_path/resources/bin/initDB.sh" -chmod 755 $dbScript source $dbScript 127.0.0.1 5432 postgres uui echo "usecase-ui database init script finished normally..." diff --git a/standalone/src/main/assembly/resources/bin/initDB.sh b/standalone/src/main/assembly/resources/bin/initDB.sh index 97e65ad3..cdfa4b5c 100644 --- a/standalone/src/main/assembly/resources/bin/initDB.sh +++ b/standalone/src/main/assembly/resources/bin/initDB.sh @@ -23,9 +23,9 @@ user_pg=$3 user_uui=$4 echo "setting postgres database password" -su - $user_pg <<EOF +#su - $user_pg <<EOF psql --command "alter user $user_pg with password '$user_pg';" -EOF +#EOF echo "start create usecase-ui database..." dbscripts_path="$main_path/resources/dbscripts/postgres" |