diff options
author | leventecsanyi <levente.csanyi@est.tech> | 2023-04-05 11:42:30 +0200 |
---|---|---|
committer | leventecsanyi <levente.csanyi@est.tech> | 2023-04-17 12:06:01 +0200 |
commit | fff80c048f90ad6b58a00329e514f0c2e5c41dd5 (patch) | |
tree | c710d2222d04afb9ce49cee29e88c4ccbb659b10 /src | |
parent | c4a18054d489a83efb99a8975585631e5ecd0b10 (diff) |
Define an interface to accept collection of cm handles for Get operation.
- Added REST endpoint (Not Implemented yet)
- Created unit test
Issue-ID: CPS-1555
Change-Id: I24ce8d663602c08cc207f4657289631439d3fb9e
Signed-off-by: leventecsanyi <levente.csanyi@est.tech>
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/org/onap/cps/ncmp/dmi/rest/controller/DmiRestController.java | 15 | ||||
-rw-r--r-- | src/test/groovy/org/onap/cps/ncmp/dmi/rest/controller/DmiRestControllerSpec.groovy | 15 |
2 files changed, 30 insertions, 0 deletions
diff --git a/src/main/java/org/onap/cps/ncmp/dmi/rest/controller/DmiRestController.java b/src/main/java/org/onap/cps/ncmp/dmi/rest/controller/DmiRestController.java index f952e224..da0ac3e1 100644 --- a/src/main/java/org/onap/cps/ncmp/dmi/rest/controller/DmiRestController.java +++ b/src/main/java/org/onap/cps/ncmp/dmi/rest/controller/DmiRestController.java @@ -105,6 +105,21 @@ public class DmiRestController implements DmiPluginApi, DmiPluginInternalApi { } /** + * This method is not implemented for ONAP DMI plugin. + * + * @param datastoreName name of the data store + * @param body list of cm-handles + * @param topic Kafka topic name + * @return (@ code ResponseEntity) response entity + */ + @Override + public ResponseEntity<Void> getResourceDataByCmHandles(final String datastoreName, + final Object body, + final String topic) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + } + + /** * This method fetches the resource for given cm handle using pass through operational or running datastore. * It filters the response on the basis of options query parameters and returns response. Passthrough Running * supports both read and write operation whereas passthrough operational does not support write operations. diff --git a/src/test/groovy/org/onap/cps/ncmp/dmi/rest/controller/DmiRestControllerSpec.groovy b/src/test/groovy/org/onap/cps/ncmp/dmi/rest/controller/DmiRestControllerSpec.groovy index 2be0b59c..acc8b63b 100644 --- a/src/test/groovy/org/onap/cps/ncmp/dmi/rest/controller/DmiRestControllerSpec.groovy +++ b/src/test/groovy/org/onap/cps/ncmp/dmi/rest/controller/DmiRestControllerSpec.groovy @@ -311,4 +311,19 @@ class DmiRestControllerSpec extends Specification { '? needs to be encoded as %3F' | 'idWith%3F' } + + def 'Get resource data for a collection of cm handles (unimplemented).'() { + given: 'an endpoint for adding a batch of cm handle Ids' + def url = "$basePathV1/ch/batch/data/ds/test-datastore?topic=test" + and: 'a request body' + def body = '{"CmHandles": []}' + when: 'the endpoint is invoked' + def response = mvc.perform( + post(url) + .contentType(MediaType.APPLICATION_JSON) + .content(body) + ).andReturn().response + then: 'the response status code is 501' + assert response.status == 501 + } } |