diff options
author | JosephKeenan <joseph.keenan@est.tech> | 2021-08-03 18:24:32 +0100 |
---|---|---|
committer | Renu Kumari <renu.kumari@bell.ca> | 2021-08-10 10:44:24 -0400 |
commit | be21595d53636e2c9b912bfbe8dfdefb81edc70f (patch) | |
tree | c40add4ce147e0ab6da7814384dd42d82e316079 /cps-ncmp-rest | |
parent | dce1d58005d90950e00b22078d82559748dcb255 (diff) |
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 <joseph.keenan@est.tech>
Diffstat (limited to 'cps-ncmp-rest')
-rw-r--r-- | cps-ncmp-rest/pom.xml | 4 | ||||
-rwxr-xr-x | cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyController.java | 13 |
2 files changed, 7 insertions, 10 deletions
diff --git a/cps-ncmp-rest/pom.xml b/cps-ncmp-rest/pom.xml index e0c4f6fbe1..dbe1af0973 100644 --- a/cps-ncmp-rest/pom.xml +++ b/cps-ncmp-rest/pom.xml @@ -68,10 +68,6 @@ <groupId>io.springfox</groupId> <artifactId>springfox-boot-starter</artifactId> </dependency> - <dependency> - <groupId>io.swagger</groupId> - <artifactId>swagger-annotations</artifactId> - </dependency> <!-- T E S T D E P E N D E N C I E S --> <dependency> <groupId>org.codehaus.groovy</groupId> 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<Void> createNode(final String jsonData, final String cmHandle, - final String parentNodeXpath) { + public ResponseEntity<Void> 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<Void> addListNodeElements(final String jsonData, final String parentNodeXpath, - final String cmHandle) { + public ResponseEntity<Void> 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<Object> replaceNode(@Valid final String jsonData, final String cmHandle, + public ResponseEntity<Object> 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<Object> updateNodeLeaves(@Valid final String jsonData, final String cmHandle, + public ResponseEntity<Object> updateNodeLeaves(final String cmHandle, @Valid final String jsonData, @Valid final String parentNodeXpath) { networkCmProxyDataService.updateNodeLeaves(cmHandle, parentNodeXpath, jsonData); return new ResponseEntity<>(HttpStatus.OK); |