From 6ddbe4af2b73a306dec89e55b8350c09b8c5766b Mon Sep 17 00:00:00 2001 From: DylanB95EST Date: Tue, 19 Jul 2022 11:36:10 +0100 Subject: Enable/Disable Data Sync for Cm Handle -Create API Which will enable/disable data sync enabled flag -Default functionality of module sync watchdog is to set to false -Remove global config param -Will set initial sync state based on data sync enabled flag -Throws an Exception if the same data sync enabled flag tries to be set -Throws Exception if state is not in READY -Data Sync enabled must be true to complete data sync process - Delete all resource data within fragment table related to synced cm handle when data sync is set to false Issue-ID: CPS-1133 Change-Id: Ib47bbd8293f083c1d705d91bd0def74e6a105c72 Signed-off-by: DylanB95EST --- .../rest/controller/NetworkCmProxyControllerSpec.groovy | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp') 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 23263c9aa..fde3087be 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() -- cgit 1.2.3-korg