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%2Fhandlers%2FNcmpDatastoreRequestHandlerSpec.groovy;fp=cps-ncmp-rest%2Fsrc%2Ftest%2Fgroovy%2Forg%2Fonap%2Fcps%2Fncmp%2Frest%2Fcontroller%2Fhandlers%2FNcmpDatastoreRequestHandlerSpec.groovy;h=bdd0e716d85327d64d13267959a8109c1f1441eb;hb=59a34f5f9e1aaea13df8903ac30ee8cb5735f205;hp=ddeac519c304080e5624bdfc6b18a612417d2125;hpb=bf75ff4d43dc9eb459deaf61920de22cf5c6f1ea;p=cps.git diff --git a/cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/controller/handlers/NcmpDatastoreRequestHandlerSpec.groovy b/cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/controller/handlers/NcmpDatastoreRequestHandlerSpec.groovy index ddeac519c..bdd0e716d 100644 --- a/cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/controller/handlers/NcmpDatastoreRequestHandlerSpec.groovy +++ b/cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/controller/handlers/NcmpDatastoreRequestHandlerSpec.groovy @@ -25,6 +25,7 @@ import org.onap.cps.ncmp.api.impl.exception.InvalidDatastoreException import org.onap.cps.ncmp.api.impl.exception.InvalidOperationException import org.onap.cps.ncmp.api.models.DataOperationDefinition import org.onap.cps.ncmp.api.models.DataOperationRequest +import org.onap.cps.ncmp.api.models.CmResourceAddress import org.onap.cps.ncmp.rest.exceptions.OperationNotSupportedException import org.onap.cps.ncmp.rest.executor.CpsNcmpTaskExecutor import spock.lang.Specification @@ -48,12 +49,13 @@ class NcmpDatastoreRequestHandlerSpec extends Specification { objectUnderTest.notificationFeatureEnabled = notificationFeatureEnabled and: 'a flag to track the network service call' def networkServiceMethodCalled = false + and: 'a CM resource address' + def cmResourceAddress = new CmResourceAddress('ds', 'ch1', 'resource1') and: 'the (mocked) service will use the flag to indicate if it is called' - mockNetworkCmProxyDataService.getResourceDataForCmHandle('ds', 'ch1', 'resource1', 'options', _, _, NO_AUTH_HEADER) >> { - networkServiceMethodCalled = true - } + mockNetworkCmProxyDataService.getResourceDataForCmHandle(cmResourceAddress, 'options', _, _, NO_AUTH_HEADER) >> + { networkServiceMethodCalled = true } when: 'get request is executed with topic = #topic' - objectUnderTest.executeRequest('ds', 'ch1', 'resource1', 'options', topic, false, NO_AUTH_HEADER) + objectUnderTest.executeRequest(cmResourceAddress, 'options', topic, false, NO_AUTH_HEADER) then: 'the task is executed in an async fashion or not' expectedCalls * spiedCpsNcmpTaskExecutor.executeTask(*_) and: 'the service request is invoked'