X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=cps-ncmp-rest%2Fsrc%2Ftest%2Fgroovy%2Forg%2Fonap%2Fcps%2Fncmp%2Frest%2Fcontroller%2FNetworkCmProxyControllerSpec.groovy;h=cca62b9ec06e4b84e30242c82b522b972e9fcd7d;hb=9e09fe868b39fd5f13092a923da3474deb0f75b9;hp=a609cfacb8521434971a8364dc59ba4af7b149d7;hpb=30dfcb0cf5f1428bf3ebecbfad3d26c336a4553e;p=cps.git 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 a609cfacb..cca62b9ec 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 @@ -258,8 +258,8 @@ class NetworkCmProxyControllerSpec extends Specification { given: 'an endpoint and json data' def searchesEndpoint = "$ncmpBasePathV1/ch/searches" String jsonData = TestUtils.getResourceFileContent('cmhandle-search.json') - and: 'the service method is invoked with module names and returns a cm handle id' - mockNetworkCmProxyDataService.executeCmHandleHasAllModulesSearch(['module1', 'module2']) >> ['some-cmhandle-id'] + and: 'the service method is invoked with module names and returns two cm handle ids' + mockNetworkCmProxyDataService.executeCmHandleHasAllModulesSearch(['module1', 'module2']) >> ['some-cmhandle-id1', 'some-cmhandle-id2'] when: 'the searches api is invoked' def response = mvc.perform(post(searchesEndpoint) .contentType(MediaType.APPLICATION_JSON) @@ -267,7 +267,7 @@ class NetworkCmProxyControllerSpec extends Specification { then: 'response status returns OK' response.status == HttpStatus.OK.value() and: 'the expected response content is returned' - response.contentAsString == '{"cmHandles":[{"cmHandleId":"some-cmhandle-id"}]}' + response.contentAsString == '{"cmHandles":[{"cmHandleId":"some-cmhandle-id1"},{"cmHandleId":"some-cmhandle-id2"}]}' } def 'Call execute cm handle searches with unrecognized condition name.'() { @@ -279,7 +279,21 @@ class NetworkCmProxyControllerSpec extends Specification { .contentType(MediaType.APPLICATION_JSON) .content(jsonData)).andReturn().response then: 'an empty cm handle identifier is returned' - response.contentAsString == '{"cmHandles":null}' + response.contentAsString == '{"cmHandles":[]}' + } + + def 'Update resource data in passthrough-running datastore.' () { + given: 'update resource data url' + def updateUrl = "$ncmpBasePathV1/ch/testCmHandle/data/ds/ncmp-datastore:passthrough-running" + + "?resourceIdentifier=parent/child" + when: 'update data resource request is performed' + def response = mvc.perform( + put(updateUrl) + .contentType(MediaType.APPLICATION_JSON_VALUE) + .accept(MediaType.APPLICATION_JSON_VALUE).content('some-request-body') + ).andReturn().response + then: 'the response status is not implemented' + response.status == HttpStatus.NOT_IMPLEMENTED.value() } }