diff options
54 files changed, 2726 insertions, 329 deletions
diff --git a/server/src/main/java/org/onap/usecaseui/server/service/customer/impl/CcvpnCustomerServiceImpl.java b/server/src/main/java/org/onap/usecaseui/server/service/customer/impl/CcvpnCustomerServiceImpl.java index ae9f9bc1..c4cc848d 100644 --- a/server/src/main/java/org/onap/usecaseui/server/service/customer/impl/CcvpnCustomerServiceImpl.java +++ b/server/src/main/java/org/onap/usecaseui/server/service/customer/impl/CcvpnCustomerServiceImpl.java @@ -91,8 +91,7 @@ public class CcvpnCustomerServiceImpl implements CcvpnCustomerService { logger.info("Execute get all service for customer : Failed"); } - } catch (Exception e) - { + } catch (Exception e) { logger.info("Execute get all service for customer : Failed"); } return null; @@ -131,9 +130,7 @@ public class CcvpnCustomerServiceImpl implements CcvpnCustomerService { } - - private Map<String, Model> readConfigToMap(ModelConfig modelConfig) - { + private Map<String, Model> readConfigToMap(ModelConfig modelConfig) { //ModelConfig modelConfig = readFile(); // Map<String, Model> modelinfo = modelConfig.getModels().stream() @@ -141,10 +138,10 @@ public class CcvpnCustomerServiceImpl implements CcvpnCustomerService { return null; } - public ModelConfig readFile() - { + public ModelConfig readFile() { JSONParser parser = new JSONParser(); - String jsonPath="/home/root1/Desktop/modelconfig.json"; + //String absolutepath = "/home/root1/Desktop/Subhosree/gerrit clone for ui backend";//configure absolute path as per systempath + String jsonPath = "/home/modelconfig.json"; String jsonString = null; ObjectMapper mapper = new ObjectMapper(); @@ -156,324 +153,11 @@ public class CcvpnCustomerServiceImpl implements CcvpnCustomerService { }); return modelInformation; - }catch (ParseException | IOException ex) - { - logger.error("Exception occured while reading configuration file:"+ex); - return null; - } - } - - -/* - @Override - public String getServiceInformation(String serviceInstanceId) throws Exception{ - //serviceInstanceId = "106"; - String result = ""; - ObjectMapper mapper = new ObjectMapper(); - List<SiteTopologyBean> beanList = new ArrayList<>(); - CostInformation costInformation = getCostInformation(); - List<SiteCost> siteCost = costInformation.getSiteCost(); - - String path ="/home/root1/Desktop/SystemConfiguration.json"; - StaticConfiguration staticConfig = ReadStaticConfiguration(path); - - String customerId = staticConfig.getSystemInformation().getCustomerName(); - String serviceType = staticConfig.getSystemInformation().getServiceType(); - - - - List<Relationship> perfectrelationship = new ArrayList<>(); - - ServiceInstance serviceInstance=null; - - //----------------------------- GET SERVICE INSTANCE INFORMATION FROM AAI : BEGIN --------------------------------------- - try{ - serviceInstance=getServiceInstancesForEdge(customerId, serviceType, serviceInstanceId); - if(serviceInstance == null) - return null; - }catch (Exception e) - { - logger.info("Query Service Instance information failed. No service information found for customer " - +customerId+" and Service Type "+serviceType); - return null; - } - //----------------------------- GET SERVICE INSTANCE INFORMATION FROM AAI : END ----------------------------------------- - - //----------------------------- Get the detailed information of Generic VNF from the service instance and filter the site resource : BEGIN --------------------------------------- - - RelationshipList genericvnfrelationshipList = serviceInstance.getRelationshipList(); - if(genericvnfrelationshipList == null) - { - logger.info("No VNF associated with the service instance : "+serviceInstanceId); - return null; - } - List<Relationship> genericRelationship = genericvnfrelationshipList.getRelationship(); - List<String> resourceurl = new ArrayList<>(); - for(Relationship tempRelation : genericRelationship) { - String relatedLink = tempRelation.getRelatedLink(); - resourceurl.add(tempRelation.getRelatedLink()); - } - - - // Need a code change here to identify VPN VNF and Site resource VNF. - - String vnfID = new String(resourceurl.get(0).substring(resourceurl.get(0).lastIndexOf("/")+1)); - - - - GenericVnf genericVnf = getGenericVnfInfo(vnfID); - - RelationshipList newrelationshipList = genericVnf.getRelationshipList(); - - perfectrelationship = newrelationshipList.getRelationship().stream().filter(x -> x.getRelatedTo() - .equalsIgnoreCase("site-resource") - || x.getRelatedTo().equalsIgnoreCase("device") - ||x.getRelatedTo().equalsIgnoreCase("edge-camera")).collect(Collectors.toList()); - - - - //----------------------------- Get the detailed information of Generic VNF from the service instance and filter the site resource : END --------------------------------------- - - - //----------------------------- Get the VNF information from the service instance and filter the site resource : END --------------------------------------- - - - for (Relationship relationship :perfectrelationship) - { - SiteTopologyBean bean = new SiteTopologyBean(); - bean.setEdgeStatus("Offline"); - //Relationship relationship = itr.next(); - if (relationship.getRelatedTo().equalsIgnoreCase("site-resource")) { - // String relatedLink = relationship.getRelatedLink(); - String siteResourceId = relationship.getRelationshipData().get(0).getRelationshipValue(); - Response<ResponseBody> rsp = this.aaiService.getSiteResourceInfo(siteResourceId).execute(); - if (rsp.isSuccessful()) { - result = new String(rsp.body().bytes()); - - SiteResource siteResource = mapper.readValue(result, SiteResource.class); - String siteResourceName = siteResource.getSiteResourceName(); - bean.setSiteStatus(siteResource.getOperationalStatus()); - String role = siteResource.getRole(); - bean.setRole(role); - String desc = siteResource.getDescription(); - bean.setDescription(desc); - bean.setSiteName(siteResourceName); - bean.setSiteId(siteResourceId); - bean.setZipCode(siteResource.getPostalcode()); - bean.setLocation(siteResource.getCity()); - /* - List<Relationship> rList = siteResource.getRelationshipList().getRelationship(); - ListIterator<Relationship> itr1 = rList.listIterator(); - while (itr1.hasNext()) { - Relationship relationship1 = itr1.next(); - if (relationship1.getRelatedTo().equalsIgnoreCase("complex")) { - String complexId = relationship1.getRelationshipData().get(0).getRelationshipValue(); - Response<ResponseBody> compResp = this.aaiService.getComplexObject(complexId).execute(); - if (compResp.isSuccessful()) { - result = new String(compResp.body().bytes()); - ComplexObj complexObj = mapper.readValue(result, ComplexObj.class); - String zipCode = complexObj.getPostalCode(); - bean.setZipCode(zipCode); - String location = complexObj.getCity(); - bean.setLocation(location); - } - } - } - */ - /*} - } - - if (relationship.getRelatedTo().equalsIgnoreCase("device")) { - String deviceId = relationship.getRelationshipData().get(0).getRelationshipValue(); - Map<String,String> resultMaps = getDeviceStatus(deviceId); - String deviceDesc = resultMaps.get("deviceDesc"); - String deviceName = resultMaps.get("deviceName"); - bean.setDeviceName(deviceName); - bean.setStatus(resultMaps.get("status")); - bean.setDeviceDesc(deviceDesc); - } - - if (relationship.getRelatedTo().equalsIgnoreCase("edge-camera")) { - String edgeCamId = relationship.getRelationshipData().get(0).getRelationshipValue(); - Response<ResponseBody> edgeRsp = this.aaiService.getEdgeInfo(edgeCamId).execute(); - if(edgeRsp.isSuccessful()) - { - result = new String(edgeRsp.body().bytes()); - EdgeCamera edgeInfo = mapper.readValue(result, EdgeCamera.class); - String edgeName = edgeInfo.getEdgeCameraName(); - String edgeIP = edgeInfo.getIpAddress(); - bean.setEdgeName(edgeName); - bean.setEdgeIP(edgeIP); - bean.setEdgeStatus("Online"); - } - } - if(bean.getStatus()!=null && bean.getEdgeStatus()!=null) { - Enum value = generateEnumValue(bean.getStatus(), bean.getEdgeStatus()); - String enumVal = value.name(); - bean.setStatEnum(enumVal); - } - - if(bean.getRole()!=null) { - if (bean.getRole().toLowerCase().contains("hub")) { - String price = siteCost.stream().filter(cost -> cost.getSiteType().equalsIgnoreCase("1")) - .map(SiteCost::getSiteCost).collect(Collectors.toList()).get(0); - bean.setPrice(price); - - } else { - String price = siteCost.stream().filter(cost -> cost.getSiteType().equalsIgnoreCase("0")) - .map(SiteCost::getSiteCost).collect(Collectors.toList()).get(0); - bean.setPrice(price); - } - bean.setSiteinterface(staticConfig.getSiteInformation().getSiteInterface()); - bean.setSubnet(staticConfig.getSiteInformation().getSubnetMask()); - beanList.add(bean); - } - } - return beanList.toString(); - } - - - public CostInformation getCostInformation() { - JSONParser parser = new JSONParser(); - String jsonPath = "/home/root1/Desktop/costconfig.json"; - String jsonString = null; - ObjectMapper mapper = new ObjectMapper(); - - try { - - Object object = parser.parse(new FileReader(jsonPath)); - //System.out.println(object.toString()); - CostInformation costInformation = mapper.readValue(object.toString(), new TypeReference<CostInformation>() { - }); - - return costInformation; } catch (ParseException | IOException ex) { - logger.error("getDataMonitorInfo exception occured:" + ex); + logger.error("Exception occured while reading configuration file:" + ex); return null; } } - public StaticConfiguration ReadStaticConfiguration(String path) - { - JSONParser parser = new JSONParser(); - - String jsonString = null; - ObjectMapper mapper = new ObjectMapper(); - - try { - - Object object = parser.parse(new FileReader(path)); - //System.out.println(object.toString()); - StaticConfiguration staticConfiguration = mapper.readValue(object.toString(), new TypeReference<StaticConfiguration>() { - }); - - return staticConfiguration; - }catch (ParseException | IOException ex) - { - logger.error("Reading static information from configuration file (StaticConfiguration.json) failed:"+ex.getMessage()); - return null; - } - } - - public ServiceInstance getServiceInstancesForEdge(String customerId, String serviceType, String serviceInstanceId) throws Exception - { - logger.info("Fire getServiceInstancesForEdge : Begin"); - ObjectMapper mapper = new ObjectMapper(); - - Response<ResponseBody> response = this.aaiService.getServiceInstancesForEdge(customerId, serviceType, serviceInstanceId).execute(); - if (response.isSuccessful()) { - logger.info("Fire getServiceInstancesForEdge : End"); - String result = new String(response.body().bytes()); - ServiceInstance serviceInstance = mapper.readValue(result, ServiceInstance.class); - return serviceInstance; - //System.out.println("Response received : "+response.body().bytes()); - } - else - { - logger.info("Fire getServiceInstancesForEdge : Failed"); - - } - - return null; - } - - public GenericVnf getGenericVnfInfo(String vnfID) throws Exception - { - ObjectMapper mapper = new ObjectMapper(); - logger.info("Fire GetGenericVnfInfo : Begin for vnfID"+vnfID); - Response<ResponseBody> deviceResponse = this.aaiService.getGenericVnfInformation(vnfID).execute(); - if (deviceResponse.isSuccessful()) { - String result = new String(deviceResponse.body().bytes()); - logger.info("Response received GetGenericVnfInfo"); - //result = result.substring(10, result.length() - 1); - GenericVnf genericVnf = mapper.readValue(result, new TypeReference<GenericVnf>() { - }); - return genericVnf; - - } else { - logger.info("Fire GetGenericVnfInfo : Failed"); - } - return null; - } - - private Map<String,String> getDeviceStatus(String deviceId) { - String result = ""; - String status = ""; - Map<String,String> resultMap = new HashMap<>(); - String deviceDesc = ""; - String deviceName = ""; - ObjectMapper mapper = new ObjectMapper(); - - try { - logger.info("aai getDeviceStatus is starting!"); - - Response<ResponseBody> response = this.aaiService.getDeviceInfo(deviceId).execute(); - - - logger.info("aai getDeviceStatus has finished!"); - if (response.isSuccessful()) { - result = new String(response.body().bytes()); - DeviceInfo deviceInfo = mapper.readValue(result, new TypeReference<DeviceInfo>() { - }); - status = deviceInfo.getOperationalStatus(); - deviceDesc = deviceInfo.getDescription(); - deviceName = deviceInfo.getDeviceName(); - if (status.isEmpty()) { - status = "activate"; - } - resultMap.put("status",status); - resultMap.put("deviceDesc",deviceDesc); - resultMap.put("deviceName",deviceName); - } else { - logger.info(String.format("Can not get getDeviceStatus[code=%s, message=%s]", response.code(), response.message())); - result = Constant.CONSTANT_FAILED; - } - } catch (IOException e) { - - logger.error("getDeviceStatus exception occured:" + e); - result = Constant.CONSTANT_FAILED; - } - return resultMap; - } - - private Enum generateEnumValue(String deviceStatus, String edgeStatus) { - StatusEnum value = null; - if(edgeStatus.equalsIgnoreCase("Online") && deviceStatus.equalsIgnoreCase("Online")) - { - value = StatusEnum.GREEN_GREEN; - } - else if(edgeStatus.equalsIgnoreCase("Offline") && deviceStatus.equalsIgnoreCase("Online")) - { - value = StatusEnum.GREEN_GREY; - } - else - { - value = StatusEnum.GREY_GREY; - } - return value; - } - - */ - -} +}
\ No newline at end of file diff --git a/server/src/main/java/org/onap/usecaseui/server/service/lcm/impl/SotnServiceQryServiceImpl.java b/server/src/main/java/org/onap/usecaseui/server/service/lcm/impl/SotnServiceQryServiceImpl.java index 203a07d7..4dd78c02 100644 --- a/server/src/main/java/org/onap/usecaseui/server/service/lcm/impl/SotnServiceQryServiceImpl.java +++ b/server/src/main/java/org/onap/usecaseui/server/service/lcm/impl/SotnServiceQryServiceImpl.java @@ -102,7 +102,9 @@ public class SotnServiceQryServiceImpl implements SotnServiceQryService { public ModelConfig readFile() { JSONParser parser = new JSONParser(); - String jsonPath = "/home/root1/Desktop/modelconfig.json"; + //String jsonPath = "/home/root1/Desktop/modelconfig.json"; + //String absolutepath = "/home/root1/Desktop/Subhosree/gerrit clone for ui backend";//configure absolute path as per systempath + String jsonPath = "/home/modelconfig.json"; String jsonString = null; ObjectMapper mapper = new ObjectMapper(); 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 1179314c..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 @@ -71,6 +71,7 @@ public class SotnServiceTemplateServiceImpl implements SotnServiceTemplateServic public ModelConfig readFile() { JSONParser parser = new JSONParser(); + //String jsonPath = "/home/modelconfig.json"; String jsonPath = "/home/modelconfig.json"; String jsonPath_2 = ""; String jsonString = null; @@ -79,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>() { }); @@ -100,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/controller/lcm/SotnServiceLcmControllerTest.java b/server/src/test/java/org/onap/usecaseui/server/controller/lcm/SotnServiceLcmControllerTest.java new file mode 100644 index 00000000..2b6789b8 --- /dev/null +++ b/server/src/test/java/org/onap/usecaseui/server/controller/lcm/SotnServiceLcmControllerTest.java @@ -0,0 +1,87 @@ +/** + * 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.controller.lcm; + +import org.junit.Before; +import org.junit.Test; +import org.onap.usecaseui.server.service.lcm.ServiceTemplateService; +import org.onap.usecaseui.server.service.lcm.SotnServiceTemplateService; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; + +import javax.servlet.http.HttpServletRequest; + +import java.util.HashMap; + +import static org.mockito.Mockito.*; + +public class SotnServiceLcmControllerTest { + + private SotnServiceTemplateService service; + private SotnServiceLcmController controller = new SotnServiceLcmController(); + + + + @Before + public void setUp() { + service = mock(SotnServiceTemplateService.class); + controller.setServiceLcmService(service); + } + + @Test + public void testinstantiateService_sotnunni() throws Exception { + HashMap<String, Object> mp = new HashMap(); + HttpServletRequest request =mock(HttpServletRequest.class); + controller.instantiateService_sotnunni(request, mp); + + verify(service, times(1)).instantiate_CCVPN_Service(mp); + + } + + @Test + public void testgetSiteInformationTopology() throws Exception + { + String servicetype = "ISAAC"; + String serviceInstanceId = "OS001"; + + controller.getSiteInformationTopology(servicetype,serviceInstanceId); + + verify(service, times(1)).getSOTNSiteInformationTopology(servicetype,serviceInstanceId); + } + + @Test + public void testgetSotnService() throws Exception{ + + String subscriptiontype = "SOTN"; + String instanceid = "123"; + + controller.getSotnService(subscriptiontype, instanceid); + + verify(service, times(1)).getService(subscriptiontype, instanceid); + } + + +// @Test +// public void testgetSotnServicestatus() throws Exception +// { +// String instanceid = "123"; +// controller.getSotnServicestatus(instanceid); +// +// verify(service, times(1)).getSOTNInstantiationstatus(instanceid); +// } + + +}
\ No newline at end of file diff --git a/server/src/test/java/org/onap/usecaseui/server/service/customer/CcvpnCustomerServiceImplTest.java b/server/src/test/java/org/onap/usecaseui/server/service/customer/CcvpnCustomerServiceImplTest.java new file mode 100644 index 00000000..7257e29c --- /dev/null +++ b/server/src/test/java/org/onap/usecaseui/server/service/customer/CcvpnCustomerServiceImplTest.java @@ -0,0 +1,99 @@ +/** + * 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.customer; + +import okhttp3.ResponseBody; +import org.junit.Before; +import org.junit.Test; +import org.onap.usecaseui.server.service.customer.impl.CcvpnCustomerServiceImpl; +import org.onap.usecaseui.server.service.lcm.domain.aai.AAIService; +import org.onap.usecaseui.server.service.sotn.impl.SOTNServiceImpl; + +import javax.servlet.ReadListener; +import javax.servlet.ServletInputStream; +import javax.servlet.http.HttpServletRequest; +import java.io.IOException; + +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 CcvpnCustomerServiceImplTest { + + CcvpnCustomerServiceImpl dsts = null; + AAIService aaiService = null; + + + @Before + public void before() throws Exception { + aaiService= mock(AAIService.class); + dsts = new CcvpnCustomerServiceImpl(aaiService); + + + } + + private HttpServletRequest mockRequest() throws IOException { + HttpServletRequest request = mock(HttpServletRequest.class); + when(request.getContentLength()).thenReturn(0); + ServletInputStream inStream = new ServletInputStream() { + @Override + public boolean isFinished() { + return false; + } + + @Override + public boolean isReady() { + return false; + } + + @Override + public void setReadListener(ReadListener readListener) { + + } + + @Override + public int read() throws IOException { + return 0; + } + }; + when(request.getInputStream()).thenReturn(inStream); + return request; + } + + @Test + public void itCanGetAllServiceInformation(){ + ResponseBody result=null; + when(aaiService.getAllServiceInformation("abc", "123")).thenReturn(successfulCall(result)); + dsts.getAllServiceInstances("abc", "123"); + } + + @Test + public void getQuerySubscriptionWithThrowsEexception(){ + when(aaiService.getServiceSubscription("123")).thenReturn(failedCall("aai is not exist!")); + dsts.querySubscriptionType("123"); + } + + @Test + public void testgetServiceInstances () + { + + } + + +} diff --git a/server/src/test/java/org/onap/usecaseui/server/service/lcm/domain/aai/bean/AAIEsrNfvoTest.java b/server/src/test/java/org/onap/usecaseui/server/service/lcm/domain/aai/bean/AAIEsrNfvoTest.java new file mode 100644 index 00000000..a6581da6 --- /dev/null +++ b/server/src/test/java/org/onap/usecaseui/server/service/lcm/domain/aai/bean/AAIEsrNfvoTest.java @@ -0,0 +1,59 @@ +/** + * Copyright 2020 Huawei 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. + */ + +package org.onap.usecaseui.server.service.lcm.domain.aai.bean; + +/** + * 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. + */ +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +public class AAIEsrNfvoTest { + + @Before + public void before() throws Exception { + } + + @After + public void after() throws Exception { + } + + @Test + public void testAAIEsrNfvoTest() throws Exception { + AAIEsrNfvo aaiEsrNfvo = new AAIEsrNfvo("123", "123", "123", "123"); + + aaiEsrNfvo.getApiRoot(); + aaiEsrNfvo.getName(); + aaiEsrNfvo.getNfvoId(); + aaiEsrNfvo.getResourceVersion(); + aaiEsrNfvo.setName("123"); + + } +} diff --git a/server/src/test/java/org/onap/usecaseui/server/service/lcm/domain/aai/bean/PInterfaceTest.java b/server/src/test/java/org/onap/usecaseui/server/service/lcm/domain/aai/bean/PInterfaceTest.java new file mode 100644 index 00000000..78d0eca9 --- /dev/null +++ b/server/src/test/java/org/onap/usecaseui/server/service/lcm/domain/aai/bean/PInterfaceTest.java @@ -0,0 +1,63 @@ +package org.onap.usecaseui.server.service.lcm.domain.aai.bean; + +import org.junit.After; +import org.junit.Before; + +/** + * 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. + */ + +public class PInterfaceTest { + + @Before + public void before() throws Exception { + } + + @After + public void after() throws Exception { + } + + public void pinterface() throws Exception + { + PInterface pInterface = new PInterface(); + RelationshipList relationshipList = new RelationshipList(); + + pInterface.getInMaint(); + pInterface.getInterfaceName(); + pInterface.getInterfaceType(); + pInterface.getNetworkInterfaceType(); + pInterface.getOperationalStatus(); + pInterface.getNetworkRef(); + pInterface.getPortDescription(); + pInterface.getRelationshipList(); + pInterface.getResourceVersion(); + pInterface.getSpeedUnits(); + pInterface.getSpeedValue(); + + pInterface.setInMaint("123"); + pInterface.setInterfaceName("123"); + pInterface.setInterfaceType("123"); + pInterface.setNetworkInterfaceType("123"); + pInterface.setNetworkRef("123"); + pInterface.setOperationalStatus("123"); + pInterface.setRelationshipList(relationshipList); + pInterface.setPortDescription("123"); + pInterface.setSpeedValue("123"); + pInterface.setSpeedUnits("123"); + + + } + +} diff --git a/server/src/test/java/org/onap/usecaseui/server/service/lcm/domain/aai/bean/RelationshipDataTest.java b/server/src/test/java/org/onap/usecaseui/server/service/lcm/domain/aai/bean/RelationshipDataTest.java new file mode 100644 index 00000000..77b69dac --- /dev/null +++ b/server/src/test/java/org/onap/usecaseui/server/service/lcm/domain/aai/bean/RelationshipDataTest.java @@ -0,0 +1,41 @@ +package org.onap.usecaseui.server.service.lcm.domain.aai.bean; +/** + * 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. + */ + +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +public class RelationshipDataTest { + + @Before + public void before() throws Exception { + } + + @After + public void after() throws Exception { + } + + public void relationshipdatatest() throws Exception + { + RelationshipData relationshipData = new RelationshipData(); + + relationshipData.getRelationshipKey(); + relationshipData.getRelationshipValue(); + relationshipData.setRelationshipKey("123"); + relationshipData.setRelationshipValue("123"); + } +} diff --git a/server/src/test/java/org/onap/usecaseui/server/service/lcm/domain/aai/bean/RelationshipListTest.java b/server/src/test/java/org/onap/usecaseui/server/service/lcm/domain/aai/bean/RelationshipListTest.java new file mode 100644 index 00000000..48a47a38 --- /dev/null +++ b/server/src/test/java/org/onap/usecaseui/server/service/lcm/domain/aai/bean/RelationshipListTest.java @@ -0,0 +1,41 @@ +package org.onap.usecaseui.server.service.lcm.domain.aai.bean; + +import org.junit.After; +import org.junit.Before; + +/** + * 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. + */ +public class RelationshipListTest { + + @Before + public void before() throws Exception { + } + + @After + public void after() throws Exception { + } + + public void relationshipListTest() throws Exception + { + RelationshipList relationshipList = new RelationshipList(); + + relationshipList.getRelationship(); + + } + +} + + diff --git a/server/src/test/java/org/onap/usecaseui/server/service/lcm/domain/aai/bean/RelationshipTest.java b/server/src/test/java/org/onap/usecaseui/server/service/lcm/domain/aai/bean/RelationshipTest.java new file mode 100644 index 00000000..85847020 --- /dev/null +++ b/server/src/test/java/org/onap/usecaseui/server/service/lcm/domain/aai/bean/RelationshipTest.java @@ -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.service.lcm.domain.aai.bean; + +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +public class RelationshipTest { + + @Before + public void before() throws Exception { + } + + @After + public void after() throws Exception { + } + + @Test + public void relationshiptest() throws Exception + { + Relationship relationship = new Relationship(); + + relationship.getRelatedLink(); + relationship.getRelatedTo(); + relationship.getRelationshipData(); + relationship.getRelationshipLabel(); + + relationship.setRelatedLink("123"); + relationship.setRelatedTo("123"); + relationship.setRelationshipLabel("123"); + + + } + +} + + diff --git a/server/src/test/java/org/onap/usecaseui/server/service/lcm/domain/so/bean/SaveOrUpdateOperationTest.java b/server/src/test/java/org/onap/usecaseui/server/service/lcm/domain/so/bean/SaveOrUpdateOperationTest.java new file mode 100644 index 00000000..14e5ed7e --- /dev/null +++ b/server/src/test/java/org/onap/usecaseui/server/service/lcm/domain/so/bean/SaveOrUpdateOperationTest.java @@ -0,0 +1,37 @@ +package org.onap.usecaseui.server.service.lcm.domain.so.bean; +/** + * 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. + */ +import org.junit.After; +import org.junit.Before; + +public class SaveOrUpdateOperationTest { + + @Before + public void before() throws Exception { + } + + @After + public void after() throws Exception { + } + + public void saveorupdateoperation () throws Exception + { + SaveOrUpdateOperationRsp saveOrUpdateOperationRsp =new SaveOrUpdateOperationRsp(); + + saveOrUpdateOperationRsp.getOperationId(); + saveOrUpdateOperationRsp.setOperationId("abc"); + } +} 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" |