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=d568a5a925883726ca75a219e53c741c198647b5;hb=7dfc3a01f327654d64451865ac05b819c5583b27;hp=06a7759be924677fe7ffa02476301c4e5f5f1d2a;hpb=e79e48d75c0a84e7f1b3cef53d29ac89321184ea;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 06a7759be..d568a5a92 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 @@ -423,6 +423,20 @@ class NetworkCmProxyControllerSpec extends Specification { response.status == HttpStatus.OK.value() } + def 'Set the data sync enabled based on the cm handle id and the data sync flag is #scenario' () { + when: 'the set data sync enabled request is invoked' + def response = mvc.perform(put("$ncmpBasePathV1/ch/some-cm-handle-id/data-sync?dataSyncEnabled=" + dataSyncEnabledFlag)) + .andReturn().response + then: 'method to set data sync enabled is called' + 1 * mockNetworkCmProxyDataService.setDataSyncEnabled('some-cm-handle-id', dataSyncEnabledFlag) + and: 'the response returns an OK http code' + response.status == HttpStatus.OK.value() + where: 'the following parameters are used' + scenario | dataSyncEnabledFlag + 'enabled' | true + 'disabled' | false + } + def dataStores() { DataStores.builder() .operationalDataStore(Operational.builder()