aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--server/src/main/java/org/onap/usecaseui/server/controller/nsmf/TaskMgtController.java20
-rw-r--r--server/src/main/java/org/onap/usecaseui/server/controller/sotn/SotnController.java41
-rw-r--r--server/src/test/java/org/onap/usecaseui/server/service/lcm/domain/aai/bean/AAIServiceSubscriptionTest.java5
-rw-r--r--server/src/test/java/org/onap/usecaseui/server/service/lcm/domain/aai/bean/EsrSystemInfoListTest.java67
4 files changed, 104 insertions, 29 deletions
diff --git a/server/src/main/java/org/onap/usecaseui/server/controller/nsmf/TaskMgtController.java b/server/src/main/java/org/onap/usecaseui/server/controller/nsmf/TaskMgtController.java
index 07c2cadf..71a66532 100644
--- a/server/src/main/java/org/onap/usecaseui/server/controller/nsmf/TaskMgtController.java
+++ b/server/src/main/java/org/onap/usecaseui/server/controller/nsmf/TaskMgtController.java
@@ -25,6 +25,8 @@ 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.GetMapping;
+import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
@@ -43,41 +45,41 @@ public class TaskMgtController {
}
@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 querySlicingTask(@PathVariable int pageNo, @PathVariable int pageSize) {
return taskMgtService.querySlicingTask(pageNo, pageSize);
}
@ResponseBody
- @RequestMapping(value = {
- "/{processingStatus}/business/pageNo/{pageNo}/pageSize/{pageSize}"}, method = RequestMethod.GET, produces = "application/json")
+ @GetMapping(value = {
+ "/{processingStatus}/business/pageNo/{pageNo}/pageSize/{pageSize}"}, produces = "application/json")
public ServiceResult querySlicingTaskByStatus(@PathVariable String processingStatus, @PathVariable int pageNo,
@PathVariable int pageSize) {
return taskMgtService.querySlicingTaskByStatus(processingStatus, pageNo, pageSize);
}
@ResponseBody
- @RequestMapping(value = {"/{taskId}/auditInfo"}, method = RequestMethod.GET, produces = "application/json")
+ @GetMapping(value = {"/{taskId}/auditInfo"}, produces = "application/json")
public ServiceResult queryTaskAuditInfo(@PathVariable String taskId) {
return taskMgtService.queryTaskAuditInfo(taskId);
}
@ResponseBody
- @RequestMapping(value = {"/auditInfo"}, method = RequestMethod.PUT, produces = "application/json")
+ @PutMapping(value = {"/auditInfo"}, produces = "application/json")
public ServiceResult updateTaskAuditInfo(@RequestBody SlicingTaskAuditInfo slicingTaskAuditInfo) {
return taskMgtService.updateTaskAuditInfo(slicingTaskAuditInfo);
}
@ResponseBody
- @RequestMapping(value = {"/{taskId}/taskCreationInfo"}, method = RequestMethod.GET, produces = "application/json")
+ @GetMapping(value = {"/{taskId}/taskCreationInfo"}, produces = "application/json")
public ServiceResult queryTaskCreationInfo(@PathVariable String taskId) {
return taskMgtService.queryTaskCreationInfo(taskId);
}
@ResponseBody
- @RequestMapping(value = {
- "/{taskId}/taskCreationProgress"}, method = RequestMethod.GET, produces = "application/json")
+ @GetMapping(value = {
+ "/{taskId}/taskCreationProgress"}, produces = "application/json")
public ServiceResult queryTaskCreationProgress(@PathVariable String taskId) {
return taskMgtService.queryTaskCreationProgress(taskId);
}
diff --git a/server/src/main/java/org/onap/usecaseui/server/controller/sotn/SotnController.java b/server/src/main/java/org/onap/usecaseui/server/controller/sotn/SotnController.java
index 5b84d8c6..3cff1ef6 100644
--- a/server/src/main/java/org/onap/usecaseui/server/controller/sotn/SotnController.java
+++ b/server/src/main/java/org/onap/usecaseui/server/controller/sotn/SotnController.java
@@ -31,6 +31,9 @@ import org.onap.usecaseui.server.util.UuiCommonUtil;
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.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@@ -54,7 +57,7 @@ public class SotnController {
this.sotnService = sotnService;
}
- @RequestMapping(value = {"/getNetWorkResources"}, method = RequestMethod.GET)
+ @GetMapping(value = {"/getNetWorkResources"})
public List<NetWorkResource> getNetWorkResources(){
List<NetWorkResource> result = new ArrayList<NetWorkResource>();
String json = sotnService.getNetWorkResources();
@@ -74,62 +77,62 @@ public class SotnController {
return result;
}
- @RequestMapping(value = {"/getPinterfaceByPnfName/{pnfName:.+}"}, method = RequestMethod.GET)
+ @GetMapping(value = {"/getPinterfaceByPnfName/{pnfName:.+}"})
public List<Pinterface> getPinterfaceByPnfName(@PathVariable(value="pnfName") String pnfName){
return sotnService.getPinterfaceByPnfName(pnfName);
}
- @RequestMapping(value = {"/getLogicalLinks"}, method = RequestMethod.GET)
+ @GetMapping(value = {"/getLogicalLinks"})
public String getLogicalLinks(){
return sotnService.getLogicalLinks();
}
- @RequestMapping(value = {"/getSpecificLogicalLink/{linkName:.+}"}, method = RequestMethod.GET)
+ @GetMapping(value = {"/getSpecificLogicalLink/{linkName:.+}"})
public String getSpecificLogicalLink(@PathVariable(value="linkName") String linkName){
return sotnService.getSpecificLogicalLink(linkName);
}
- @RequestMapping(value = {"/getHostUrl/{aaiId:.+}"}, method = RequestMethod.GET)
+ @GetMapping(value = {"/getHostUrl/{aaiId:.+}"})
public String getHostUrl(@PathVariable(value="aaiId") String aaiId){
return sotnService.getHostUrl(aaiId);
}
- @RequestMapping(value = {"/getExtAaiId/{aaiId:.+}"}, method = RequestMethod.GET)
+ @GetMapping(value = {"/getExtAaiId/{aaiId:.+}"})
public String getExtAaiId(@PathVariable(value="aaiId") String aaiId){
return sotnService.getExtAaiId(aaiId);
}
- @RequestMapping(value = {"/createHostUrl/{aaiId:.+}"}, method = RequestMethod.PUT)
+ @PutMapping(value = {"/createHostUrl/{aaiId:.+}"})
public String createHostUrl(HttpServletRequest request,@PathVariable(value="aaiId") String aaiId){
return sotnService.createHostUrl(request, aaiId);
}
- @RequestMapping(value = {"/createTopoNetwork/{networkId:.+}"}, method = RequestMethod.PUT)
+ @PutMapping(value = {"/createTopoNetwork/{networkId:.+}"})
public String createTopoNetwork(HttpServletRequest request,@PathVariable(value="networkId") String networkId){
return sotnService.createTopoNetwork(request,networkId);
}
- @RequestMapping(value = {"/pnf/{pnfName:.+}/p-interfaces/p-interface/{tp-id:.+}/createTerminationPoint"}, method = RequestMethod.PUT)
+ @PutMapping(value = {"/pnf/{pnfName:.+}/p-interfaces/p-interface/{tp-id:.+}/createTerminationPoint"})
public String createTerminationPoint(HttpServletRequest request,@PathVariable(value="pnfName") String pnfName,@PathVariable(value="tp-id") String tpId){
return sotnService.createTerminationPoint(request,pnfName,tpId);
}
- @RequestMapping(value = {"/createLink/{linkName:.+}"}, method = RequestMethod.PUT)
+ @PutMapping(value = {"/createLink/{linkName:.+}"})
public String createLink(HttpServletRequest request,@PathVariable(value="linkName") String linkName){
return sotnService.createLink(request, linkName);
}
- @RequestMapping(value = {"/createPnf/{pnfName:.+}"}, method = RequestMethod.PUT)
+ @PutMapping(value = {"/createPnf/{pnfName:.+}"})
public String createPnf(HttpServletRequest request,@PathVariable(value="pnfName") String pnfName){
return sotnService.createPnf(request, pnfName);
}
- @RequestMapping(value = {"/deleteLink/{linkName:.+}/{resourceVersion:.+}"}, method = RequestMethod.DELETE)
+ @DeleteMapping(value = {"/deleteLink/{linkName:.+}/{resourceVersion:.+}"})
public String deleteLink(@PathVariable(value="linkName") String linkName,@PathVariable(value="resourceVersion") String resourceVersion){
return sotnService.deleteLink(linkName,resourceVersion);
}
- @RequestMapping(value = {"/getServiceInstanceInfo"}, method = RequestMethod.GET)
+ @GetMapping(value = {"/getServiceInstanceInfo"})
public String getServiceInstanceInfo(HttpServletRequest request){
String customerId = request.getParameter("customerId");
String serviceType = request.getParameter("serviceType");
@@ -137,12 +140,12 @@ public class SotnController {
return sotnService.serviceInstanceInfo(customerId, serviceType, serviceId);
}
- @RequestMapping(value = {"/getPnfInfo/{pnfName:.+}"}, method = RequestMethod.GET)
+ @GetMapping(value = {"/getPnfInfo/{pnfName:.+}"})
public String getPnfInfo(@PathVariable(value="pnfName") String pnfName){
return sotnService.getPnfInfo(pnfName);
}
- @RequestMapping(value = {"/getAllottedResources"}, method = RequestMethod.GET)
+ @GetMapping(value = {"/getAllottedResources"})
public String getAllottedResources(HttpServletRequest request){
String customerId = request.getParameter("customerId");
String serviceType = request.getParameter("serviceType");
@@ -150,24 +153,24 @@ public class SotnController {
return sotnService.getAllottedResources(customerId, serviceType,serviceId);
}
- @RequestMapping(value = {"/getConnectivityInfo/{connectivityId:.+}"}, method = RequestMethod.GET)
+ @GetMapping(value = {"/getConnectivityInfo/{connectivityId:.+}"})
public String getConnectivityInfo(@PathVariable(value="connectivityId") String connectivityId){
return sotnService.getConnectivityInfo(connectivityId);
}
- @RequestMapping(value = {"/getPinterfaceByVpnId/{vpnId:.+}"}, method = RequestMethod.GET)
+ @GetMapping(value = {"/getPinterfaceByVpnId/{vpnId:.+}"})
public String getPinterfaceByVpnId(@PathVariable(value="vpnId") String vpnId){
return sotnService.getPinterfaceByVpnId(vpnId);
}
- @RequestMapping(value = {"/getServiceInstanceList"}, method = RequestMethod.GET)
+ @GetMapping(value = {"/getServiceInstanceList"})
public String getServiceInstanceList(HttpServletRequest request){
String customerId = request.getParameter("customerId");
String serviceType = request.getParameter("serviceType");
return sotnService.getServiceInstances(customerId, serviceType);
}
- @RequestMapping(value = {"/deleteExtNetWork"}, method = RequestMethod.DELETE)
+ @DeleteMapping(value = {"/deleteExtNetWork"})
public String deleteExtNetwork(@RequestParam String extNetworkId,@RequestParam(value="resourceVersion") String resourceVersion){
return sotnService.deleteExtNetwork(extNetworkId,resourceVersion);
}
diff --git a/server/src/test/java/org/onap/usecaseui/server/service/lcm/domain/aai/bean/AAIServiceSubscriptionTest.java b/server/src/test/java/org/onap/usecaseui/server/service/lcm/domain/aai/bean/AAIServiceSubscriptionTest.java
index 9344e3c4..e584e96e 100644
--- a/server/src/test/java/org/onap/usecaseui/server/service/lcm/domain/aai/bean/AAIServiceSubscriptionTest.java
+++ b/server/src/test/java/org/onap/usecaseui/server/service/lcm/domain/aai/bean/AAIServiceSubscriptionTest.java
@@ -15,7 +15,8 @@
*/
package org.onap.usecaseui.server.service.lcm.domain.aai.bean;
-import org.junit.Test;
+import org.junit.Assert;
+import org.junit.Test;
import org.junit.Before;
import org.junit.After;
import org.junit.runner.RunWith;
@@ -54,5 +55,7 @@ public class AAIServiceSubscriptionTest {
public void testAAIServiceSubscription() throws Exception {
AAIServiceSubscription ass = new AAIServiceSubscription("serviceType","resourceVersion");
ass.getServiceType();
+ Assert.assertEquals(ass.getServiceType(),"serviceType");
+ Assert.assertEquals(ass.getResourceVersion(),"resourceVersion");
}
}
diff --git a/server/src/test/java/org/onap/usecaseui/server/service/lcm/domain/aai/bean/EsrSystemInfoListTest.java b/server/src/test/java/org/onap/usecaseui/server/service/lcm/domain/aai/bean/EsrSystemInfoListTest.java
new file mode 100644
index 00000000..98b41fbf
--- /dev/null
+++ b/server/src/test/java/org/onap/usecaseui/server/service/lcm/domain/aai/bean/EsrSystemInfoListTest.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.Test;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import static org.junit.Assert.assertNotNull;
+
+public class EsrSystemInfoListTest {
+ @Test
+ public void testGetmethod(){
+ 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");
+
+ List rspObj=new ArrayList<EsrSystemInfo>();
+ rspObj.add(esr);
+ EsrSystemInfoList list=new EsrSystemInfoList();
+ list.setEsrSystemInfo(rspObj);
+ assertNotNull(list);
+ }
+}