From be21595d53636e2c9b912bfbe8dfdefb81edc70f Mon Sep 17 00:00:00 2001 From: JosephKeenan Date: Tue, 3 Aug 2021 18:24:32 +0100 Subject: Upgrade Swager Codegen-maven-plugin - Removed swagger annotations dependency as latest plugin generates code using v3 annotations. - updated the method signature as per the new generated code - removed unnecessary mock springbeans from the WebMvcTest Issue-ID: CPS-205 Change-Id: Ie7911d7389dca587bde945d913f458de46027e0f Signed-off-by: JosephKeenan --- .../cps/ncmp/rest/controller/NetworkCmProxyController.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'cps-ncmp-rest/src') diff --git a/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyController.java b/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyController.java index e9e022345f..3d771b6c51 100755 --- a/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyController.java +++ b/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyController.java @@ -27,6 +27,7 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; import java.util.Collection; import javax.validation.Valid; +import javax.validation.constraints.NotNull; import org.onap.cps.ncmp.api.NetworkCmProxyDataService; import org.onap.cps.ncmp.api.models.DmiPluginRegistration; import org.onap.cps.ncmp.rest.api.NetworkCmProxyApi; @@ -66,8 +67,8 @@ public class NetworkCmProxyController implements NetworkCmProxyApi { */ @Override @Deprecated(forRemoval = false) - public ResponseEntity createNode(final String jsonData, final String cmHandle, - final String parentNodeXpath) { + public ResponseEntity createNode(final String cmHandle, @Valid final String jsonData, + @Valid final String parentNodeXpath) { networkCmProxyDataService.createDataNode(cmHandle, parentNodeXpath, jsonData); return new ResponseEntity<>(HttpStatus.CREATED); } @@ -78,8 +79,8 @@ public class NetworkCmProxyController implements NetworkCmProxyApi { */ @Override @Deprecated(forRemoval = false) - public ResponseEntity addListNodeElements(final String jsonData, final String parentNodeXpath, - final String cmHandle) { + public ResponseEntity addListNodeElements(@NotNull @Valid final String parentNodeXpath, + final String cmHandle, @Valid final String jsonData) { networkCmProxyDataService.addListNodeElements(cmHandle, parentNodeXpath, jsonData); return new ResponseEntity<>(HttpStatus.CREATED); } @@ -132,7 +133,7 @@ public class NetworkCmProxyController implements NetworkCmProxyApi { */ @Override @Deprecated(forRemoval = false) - public ResponseEntity replaceNode(@Valid final String jsonData, final String cmHandle, + public ResponseEntity replaceNode(final String cmHandle, @Valid final String jsonData, @Valid final String parentNodeXpath) { networkCmProxyDataService.replaceNodeTree(cmHandle, parentNodeXpath, jsonData); return new ResponseEntity<>(HttpStatus.OK); @@ -144,7 +145,7 @@ public class NetworkCmProxyController implements NetworkCmProxyApi { */ @Override @Deprecated(forRemoval = false) - public ResponseEntity updateNodeLeaves(@Valid final String jsonData, final String cmHandle, + public ResponseEntity updateNodeLeaves(final String cmHandle, @Valid final String jsonData, @Valid final String parentNodeXpath) { networkCmProxyDataService.updateNodeLeaves(cmHandle, parentNodeXpath, jsonData); return new ResponseEntity<>(HttpStatus.OK); -- cgit 1.2.3-korg