From 258bc5da642cd2cd606a9c25b861e40560703974 Mon Sep 17 00:00:00 2001 From: "Benjamin, Max (mb388a)" Date: Tue, 21 Aug 2018 14:43:36 -0400 Subject: added unit test for class Adding unit tests for the infraactiverepositorycustomcontroller and fixing an issue found while adding the test Change-Id: Ic177f75c995ee789902dc9ad1b7df0e997b998c9 Issue-ID: SO-876 Signed-off-by: Benjamin, Max (mb388a) --- ...raActiveRequestsRepositoryCustomController.java | 25 +++++++++++++--------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'adapters/mso-requests-db-adapter/src/main/java') diff --git a/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/InfraActiveRequestsRepositoryCustomController.java b/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/InfraActiveRequestsRepositoryCustomController.java index dea6512d38..34bf9cb0f5 100644 --- a/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/InfraActiveRequestsRepositoryCustomController.java +++ b/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/InfraActiveRequestsRepositoryCustomController.java @@ -24,12 +24,13 @@ import org.onap.so.db.request.beans.InfraActiveRequests; import org.onap.so.db.request.data.controller.InstanceNameDuplicateCheckRequest; import org.onap.so.db.request.data.repository.InfraActiveRequestsRepository; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; + -import javax.ws.rs.PathParam; import java.util.List; import java.util.Map; @@ -38,20 +39,24 @@ public class InfraActiveRequestsRepositoryCustomController { @Autowired InfraActiveRequestsRepository infraActiveRequestsRepository; + @RequestMapping(method = RequestMethod.POST, value = "/infraActiveRequests/getCloudOrchestrationFiltersFromInfraActive") - public List getCloudOrchestrationFiltersFromInfraActive(@RequestBody Map orchestrationMap){ + public List getCloudOrchestrationFiltersFromInfraActive(@RequestBody Map orchestrationMap) { return infraActiveRequestsRepository.getCloudOrchestrationFiltersFromInfraActive(orchestrationMap); } + @RequestMapping(method = RequestMethod.POST, value = "/infraActiveRequests/getOrchestrationFiltersFromInfraActive") - public List getOrchestrationFiltersFromInfraActive(@RequestBody Map> orchestrationMap){ - return infraActiveRequestsRepository.getOrchestrationFiltersFromInfraActive(orchestrationMap); + public List getOrchestrationFiltersFromInfraActive(@RequestBody Map> orchestrationMap) { + return infraActiveRequestsRepository.getOrchestrationFiltersFromInfraActive(orchestrationMap); } - @RequestMapping(method = RequestMethod.GET, value = "/infraActiveRequests/checkVnfIdStatus/{nsInstanceId}") - public InfraActiveRequests checkVnfIdStatus(@PathParam("nsInstanceId") String operationalEnvironmentId){ + + @RequestMapping(method = RequestMethod.GET, value = "/infraActiveRequests/checkVnfIdStatus/{operationalEnvironmentId}") + public InfraActiveRequests checkVnfIdStatus(@PathVariable("operationalEnvironmentId") String operationalEnvironmentId) { return infraActiveRequestsRepository.checkVnfIdStatus(operationalEnvironmentId); } + @RequestMapping(method = RequestMethod.POST, value = "/infraActiveRequests/checkInstanceNameDuplicate") - public InfraActiveRequests checkInstanceNameDuplicate(@RequestBody InstanceNameDuplicateCheckRequest instanceNameDuplicateCheckRequest){ - return infraActiveRequestsRepository.checkInstanceNameDuplicate(instanceNameDuplicateCheckRequest.getInstanceIdMap(), instanceNameDuplicateCheckRequest.getInstanceName(),instanceNameDuplicateCheckRequest.getRequestScope()); + public InfraActiveRequests checkInstanceNameDuplicate(@RequestBody InstanceNameDuplicateCheckRequest instanceNameDuplicateCheckRequest) { + return infraActiveRequestsRepository.checkInstanceNameDuplicate(instanceNameDuplicateCheckRequest.getInstanceIdMap(), instanceNameDuplicateCheckRequest.getInstanceName(), instanceNameDuplicateCheckRequest.getRequestScope()); } } -- cgit 1.2.3-korg