diff options
5 files changed, 162 insertions, 31 deletions
diff --git a/server/src/main/java/org/onap/usecaseui/server/controller/lcm/SotnServiceQryController.java b/server/src/main/java/org/onap/usecaseui/server/controller/lcm/SotnServiceQryController.java index 677e655a..9c68a65d 100644 --- a/server/src/main/java/org/onap/usecaseui/server/controller/lcm/SotnServiceQryController.java +++ b/server/src/main/java/org/onap/usecaseui/server/controller/lcm/SotnServiceQryController.java @@ -24,6 +24,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseBody; @@ -50,7 +51,7 @@ public class SotnServiceQryController { } @ResponseBody - @RequestMapping(value = {"/uui-lcm/Sotnservices/ServiceInstances/{serviceType}"}, method = RequestMethod.GET , produces = "application/json") + @GetMapping(value = {"/uui-lcm/Sotnservices/ServiceInstances/{serviceType}"}, produces = "application/json") public String getSotnServiceInstances(@PathVariable(value="serviceType") String serviceType){ System.out.println("Get Service Instance called."); String response = sotnServiceQryService.getServiceInstances(serviceType); @@ -58,7 +59,7 @@ public class SotnServiceQryController { } @ResponseBody - @RequestMapping(value = {"/uui-lcm/customers/service-subscriptions"}, method = RequestMethod.GET , produces = "application/json") + @GetMapping(value = {"/uui-lcm/customers/service-subscriptions"}, produces = "application/json") public String getServiceSubscriptions(){ System.out.println("Get Service Subscription called."); String response = ccvpnCustomerService.querySubscriptionType(); diff --git a/server/src/main/java/org/onap/usecaseui/server/controller/nsmf/ResourceMgtController.java b/server/src/main/java/org/onap/usecaseui/server/controller/nsmf/ResourceMgtController.java index 40adc9c9..4187fc1a 100644 --- a/server/src/main/java/org/onap/usecaseui/server/controller/nsmf/ResourceMgtController.java +++ b/server/src/main/java/org/onap/usecaseui/server/controller/nsmf/ResourceMgtController.java @@ -23,6 +23,9 @@ import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.CrossOrigin; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseBody; @@ -41,103 +44,103 @@ public class ResourceMgtController { } @ResponseBody - @RequestMapping(value = { - "/business/pageNo/{pageNo}/pageSize/{pageSize}"}, method = RequestMethod.GET, produces = "application/json") + @GetMapping(value = { + "/business/pageNo/{pageNo}/pageSize/{pageSize}"}, produces = "application/json") public ServiceResult querySlicingBusiness(@PathVariable int pageNo, @PathVariable int pageSize) { return resourceMgtService.querySlicingBusiness(pageNo, pageSize); } @ResponseBody - @RequestMapping(value = { - "/{businessStatus}/business/pageNo/{pageNo}/pageSize/{pageSize}"}, method = RequestMethod.GET, produces = "application/json") + @GetMapping(value = { + "/{businessStatus}/business/pageNo/{pageNo}/pageSize/{pageSize}"}, produces = "application/json") public ServiceResult querySlicingBusinessByStatus(@PathVariable String businessStatus, @PathVariable int pageNo, @PathVariable int pageSize) { return resourceMgtService.querySlicingBusinessByStatus(businessStatus, pageNo, pageSize); } @ResponseBody - @RequestMapping(value = { - "/business/{businessId}/details"}, method = RequestMethod.GET, produces = "application/json") + @GetMapping(value = { + "/business/{businessId}/details"}, produces = "application/json") public ServiceResult querySlicingBusinessDetails(@PathVariable String businessId) { return resourceMgtService.querySlicingBusinessDetails(businessId); } @ResponseBody - @RequestMapping(value = { - "/nsi/instances/pageNo/{pageNo}/pageSize/{pageSize}"}, method = RequestMethod.GET, produces = "application/json") + @GetMapping(value = { + "/nsi/instances/pageNo/{pageNo}/pageSize/{pageSize}"}, produces = "application/json") public ServiceResult queryNsiInstances(@PathVariable int pageNo, @PathVariable int pageSize) { return resourceMgtService.queryNsiInstances(pageNo, pageSize); } @ResponseBody - @RequestMapping(value = { - "/nsi/{instanceStatus}/instances/pageNo/{pageNo}/pageSize/{pageSize}"}, method = RequestMethod.GET, produces = "application/json") + @GetMapping(value = { + "/nsi/{instanceStatus}/instances/pageNo/{pageNo}/pageSize/{pageSize}"}, produces = "application/json") public ServiceResult queryNsiInstancesByStatus(@PathVariable String instanceStatus, @PathVariable int pageNo, @PathVariable int pageSize) { return resourceMgtService.queryNsiInstancesByStatus(instanceStatus, pageNo, pageSize); } @ResponseBody - @RequestMapping(value = {"/nsi/{nsiId}/details"}, method = RequestMethod.GET, produces = "application/json") + @GetMapping(value = {"/nsi/{nsiId}/details"}, produces = "application/json") public ServiceResult queryNsiDetails(@PathVariable String nsiId) { return resourceMgtService.queryNsiDetails(nsiId); } @ResponseBody - @RequestMapping(value = {"/nsi/{nsiId}/nssiInstances"}, method = RequestMethod.GET, produces = "application/json") + @GetMapping(value = {"/nsi/{nsiId}/nssiInstances"}, produces = "application/json") public ServiceResult queryNsiRelatedNssiInfo(@PathVariable String nsiId) { return resourceMgtService.queryNsiRelatedNssiInfo(nsiId); } @ResponseBody - @RequestMapping(value = { - "/nssi/instances/pageNo/{pageNo}/pageSize/{pageSize}"}, method = RequestMethod.GET, produces = "application/json") + @GetMapping(value = { + "/nssi/instances/pageNo/{pageNo}/pageSize/{pageSize}"}, produces = "application/json") public ServiceResult queryNssiInstances(@PathVariable int pageNo, @PathVariable int pageSize) { return resourceMgtService.queryNssiInstances(pageNo, pageSize); } @ResponseBody - @RequestMapping(value = { - "/nssi/instanceStatus/{instanceStatus}/instances/pageNo/{pageNo}/pageSize/{pageSize}"}, method = RequestMethod.GET, produces = "application/json") + @GetMapping(value = { + "/nssi/instanceStatus/{instanceStatus}/instances/pageNo/{pageNo}/pageSize/{pageSize}"}, produces = "application/json") public ServiceResult queryNssiInstancesByStatus(@PathVariable String instanceStatus, @PathVariable int pageNo, @PathVariable int pageSize) { return resourceMgtService.queryNssiInstancesByStatus(instanceStatus, pageNo, pageSize); } @ResponseBody - @RequestMapping(value = { - "/nssi/environmentContext/{environmentContext}/instances/pageNo/{pageNo}/pageSize/{pageSize}"}, method = RequestMethod.GET, produces = "application/json") + @GetMapping(value = { + "/nssi/environmentContext/{environmentContext}/instances/pageNo/{pageNo}/pageSize/{pageSize}"}, produces = "application/json") public ServiceResult queryNssiInstancesByEnvironment(@PathVariable String environmentContext, @PathVariable int pageNo, @PathVariable int pageSize) { return resourceMgtService.queryNssiInstancesByEnvironment(environmentContext, pageNo, pageSize); } @ResponseBody - @RequestMapping(value = {"/nssi/{nssiId}/details"}, method = RequestMethod.GET, produces = "application/json") + @GetMapping(value = {"/nssi/{nssiId}/details"}, produces = "application/json") public ServiceResult queryNssiDetails(@PathVariable String nssiId) { return resourceMgtService.queryNssiDetails(nssiId); } @ResponseBody - @RequestMapping(value = {"/{serviceId}/activate"}, method = RequestMethod.PUT, produces = "application/json") + @PutMapping(value = {"/{serviceId}/activate"}, produces = "application/json") public ServiceResult activateSlicingService(@PathVariable(value = "serviceId") String serviceId) { return resourceMgtService.activateSlicingService(serviceId); } @ResponseBody - @RequestMapping(value = {"/{serviceId}/deactivate"}, method = RequestMethod.PUT, produces = "application/json") + @PutMapping(value = {"/{serviceId}/deactivate"}, produces = "application/json") public ServiceResult deactivateSlicingService(@PathVariable(value = "serviceId") String serviceId) { return resourceMgtService.deactivateSlicingService(serviceId); } @ResponseBody - @RequestMapping(value = {"/{serviceId}"}, method = RequestMethod.DELETE, produces = "application/json") + @DeleteMapping(value = {"/{serviceId}"}, produces = "application/json") public ServiceResult terminateSlicingService(@PathVariable(value = "serviceId") String serviceId) { return resourceMgtService.terminateSlicingService(serviceId); } @ResponseBody - @RequestMapping(value = {"/{serviceId}/progress"}, method = RequestMethod.GET, produces = "application/json") + @GetMapping(value = {"/{serviceId}/progress"}, produces = "application/json") public ServiceResult queryOperationProgress(@PathVariable(value = "serviceId") String serviceId) { return resourceMgtService.queryOperationProgress(serviceId); } diff --git a/server/src/main/java/org/onap/usecaseui/server/controller/nsmf/ResourceMonitorController.java b/server/src/main/java/org/onap/usecaseui/server/controller/nsmf/ResourceMonitorController.java index 3431412e..24ef506d 100644 --- a/server/src/main/java/org/onap/usecaseui/server/controller/nsmf/ResourceMonitorController.java +++ b/server/src/main/java/org/onap/usecaseui/server/controller/nsmf/ResourceMonitorController.java @@ -25,6 +25,7 @@ import org.springframework.web.bind.annotation.CrossOrigin; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseBody; @@ -43,8 +44,8 @@ public class ResourceMonitorController { } @ResponseBody - @RequestMapping(value = { - "/queryTimestamp/{queryTimestamp}/trafficData"}, method = RequestMethod.POST, produces = "application/json") + @PostMapping(value = { + "/queryTimestamp/{queryTimestamp}/trafficData"}, produces = "application/json") public ServiceResult querySlicingUsageTraffic(@PathVariable(value = "queryTimestamp") String queryTimestamp, @RequestBody ServiceList serviceList) { @@ -52,8 +53,8 @@ public class ResourceMonitorController { } @ResponseBody - @RequestMapping(value = { - "/queryTimestamp/{queryTimestamp}/onlineUsers"}, method = RequestMethod.POST, produces = "application/json") + @PostMapping(value = { + "/queryTimestamp/{queryTimestamp}/onlineUsers"}, produces = "application/json") public ServiceResult querySlicingOnlineUserNumber(@PathVariable(value = "queryTimestamp") String queryTimestamp, @RequestBody ServiceList serviceList) { @@ -61,8 +62,8 @@ public class ResourceMonitorController { } @ResponseBody - @RequestMapping(value = { - "/queryTimestamp/{queryTimestamp}/bandwidth"}, method = RequestMethod.POST, produces = "application/json") + @PostMapping(value = { + "/queryTimestamp/{queryTimestamp}/bandwidth"}, produces = "application/json") public ServiceResult querySlicingTotalBandwidth(@PathVariable(value = "queryTimestamp") String queryTimestamp, @RequestBody ServiceList serviceList) { diff --git a/server/src/test/java/org/onap/usecaseui/server/service/lcm/domain/aai/bean/AAIOrchestratorRspTest.java b/server/src/test/java/org/onap/usecaseui/server/service/lcm/domain/aai/bean/AAIOrchestratorRspTest.java new file mode 100644 index 00000000..a5beb5c4 --- /dev/null +++ b/server/src/test/java/org/onap/usecaseui/server/service/lcm/domain/aai/bean/AAIOrchestratorRspTest.java @@ -0,0 +1,59 @@ +/*- + * ============LICENSE_START============================================ + * ONAP + * ===================================================================== + * Copyright (C) 2020 IBM Intellectual Property. All rights reserved. + * ===================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software 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. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * 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. + * + * ============LICENSE_END================================================ + * + * + */ + +package org.onap.usecaseui.server.service.lcm.domain.aai.bean; + +import junit.framework.Assert.*; +import org.junit.Test; + +import java.util.ArrayList; +import java.util.List; + +import static org.junit.Assert.assertNotNull; + +public class AAIOrchestratorRspTest { + @Test + public void testGetEsrNfvo(){ + AAIEsrNfvo aaiEsrNfvo = new AAIEsrNfvo("123", "123", "123", "123"); + AAIOrchestratorRsp rsp=new AAIOrchestratorRsp(); + List rspObj=new ArrayList<AAIEsrNfvo>(); + rspObj.add(aaiEsrNfvo); + rsp.setEsrNfvo(rspObj); + assertNotNull(rsp); + } +} diff --git a/server/src/test/java/org/onap/usecaseui/server/service/lcm/domain/aai/bean/EsrSystemInfoTest.java b/server/src/test/java/org/onap/usecaseui/server/service/lcm/domain/aai/bean/EsrSystemInfoTest.java new file mode 100644 index 00000000..b912b785 --- /dev/null +++ b/server/src/test/java/org/onap/usecaseui/server/service/lcm/domain/aai/bean/EsrSystemInfoTest.java @@ -0,0 +1,67 @@ +/*- + * ============LICENSE_START============================================ + * ONAP + * ===================================================================== + * Copyright (C) 2020 IBM Intellectual Property. All rights reserved. + * ===================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software 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. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * 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. + * + * ============LICENSE_END================================================ + * + * + */ +package org.onap.usecaseui.server.service.lcm.domain.aai.bean; + +import org.junit.Assert; +import org.junit.Test; + +public class EsrSystemInfoTest { + + @Test + public void testGetterMethods(){ + EsrSystemInfo esr= new EsrSystemInfo(); + esr.setEsrSystemInfoId("id"); + esr.setPassword("test123"); + esr.setResourceVersion("1.0"); + esr.setServiceUrl("www.example.com"); + esr.setSystemName("test"); + esr.setSystemType("test"); + esr.setVendor("vendor"); + esr.setUserName("test"); + esr.setVersion("1.0"); + Assert.assertEquals(esr.getEsrSystemInfoId(),"id"); + Assert.assertEquals(esr.getPassword(),"test123"); + Assert.assertEquals(esr.getResourceVersion(),"1.0"); + Assert.assertEquals(esr.getServiceUrl(),"www.example.com"); + Assert.assertEquals(esr.getSystemName(),"test"); + Assert.assertEquals(esr.getSystemType(),"test"); + Assert.assertEquals(esr.getVendor(),"vendor"); + Assert.assertEquals(esr.getUserName(),"test"); + Assert.assertEquals(esr.getVersion(),"1.0"); + } +} |