summaryrefslogtreecommitdiffstats
path: root/cps-ncmp-rest/src/test
diff options
context:
space:
mode:
authortragait <rahul.tyagi@est.tech>2021-08-16 15:12:36 +0100
committertragait <rahul.tyagi@est.tech>2021-08-19 12:46:37 +0100
commitc328551bdfd069343cc4c4e0249516d07938c78a (patch)
tree5beae0e58a123d67a4e89e904bc24d5239942437 /cps-ncmp-rest/src/test
parent24112c0a500e94dc6068be71105874f8d81678b7 (diff)
get resource data for operational passthrough
Issue-ID: CPS-487 Signed-off-by: tragait <rahul.tyagi@est.tech> Change-Id: Id1b761f3f6a388556d0cc334fd6f196c78badc39
Diffstat (limited to 'cps-ncmp-rest/src/test')
-rw-r--r--cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/controller/NetworkCmProxyControllerSpec.groovy20
1 files changed, 20 insertions, 0 deletions
diff --git a/cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/controller/NetworkCmProxyControllerSpec.groovy b/cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/controller/NetworkCmProxyControllerSpec.groovy
index f537980ac8..b2a060c278 100644
--- a/cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/controller/NetworkCmProxyControllerSpec.groovy
+++ b/cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/controller/NetworkCmProxyControllerSpec.groovy
@@ -196,5 +196,25 @@ class NetworkCmProxyControllerSpec extends Specification {
response.status == HttpStatus.CREATED.value()
}
+ def 'Get Resource Data from pass-through operational.' () {
+ given: 'resource data url'
+ def getUrl = "$basePath/v1/ch/testCmHandle/data/ds/ncmp-datastore:passthrough-operational" +
+ "/testResourceIdentifier?fields=testFields&depth=5"
+ when: 'get data resource request is performed'
+ def response = mvc.perform(
+ get(getUrl)
+ .contentType(MediaType.APPLICATION_JSON)
+ .accept(MediaType.APPLICATION_JSON_VALUE)
+ ).andReturn().response
+ then: 'the NCMP data service is called with getResourceDataOperationalFoCmHandle'
+ 1 * mockNetworkCmProxyDataService.getResourceDataOperationalFoCmHandle('testCmHandle',
+ 'testResourceIdentifier',
+ 'application/json',
+ 'testFields',
+ 5)
+ and: 'response status is Ok'
+ response.status == HttpStatus.OK.value()
+ }
+
}