summaryrefslogtreecommitdiffstats
path: root/cps-ncmp-service/src/test/groovy
diff options
context:
space:
mode:
authordanielhanrahan <daniel.hanrahan@est.tech>2023-07-10 10:47:36 +0100
committerDaniel Hanrahan <daniel.hanrahan@est.tech>2023-07-10 12:51:41 +0000
commit0ed77bfc78fbb1f33fe6708234759dab2413e0f7 (patch)
tree4968f1a611309b563a758f55b22025a4167a1ed4 /cps-ncmp-service/src/test/groovy
parente05a59a2361394d6fc4a93193b0ed35ba305fcf8 (diff)
NCMP fails to start if /subscription-registry already exists
cpsDataService only throws AlreadyDefinedException, not AlreadyDefinedExceptionBatch. This causes NcmpStartupException to be thrown during startup, if /subscription-registry exists. Issue-ID: CPS-1783 Signed-off-by: danielhanrahan <daniel.hanrahan@est.tech> Change-Id: I5667d891f855ef47ca2475891f9216be102932ed
Diffstat (limited to 'cps-ncmp-service/src/test/groovy')
-rw-r--r--cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/init/SubscriptionModelLoaderSpec.groovy3
1 files changed, 2 insertions, 1 deletions
diff --git a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/init/SubscriptionModelLoaderSpec.groovy b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/init/SubscriptionModelLoaderSpec.groovy
index b4e7813db9..128895bae4 100644
--- a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/init/SubscriptionModelLoaderSpec.groovy
+++ b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/init/SubscriptionModelLoaderSpec.groovy
@@ -28,6 +28,7 @@ import org.onap.cps.api.CpsDataService
import org.onap.cps.api.CpsModuleService
import org.onap.cps.ncmp.api.impl.exception.NcmpStartUpException
import org.onap.cps.spi.exceptions.AlreadyDefinedException
+import org.onap.cps.spi.exceptions.AlreadyDefinedExceptionBatch
import org.onap.cps.spi.exceptions.DataValidationException
import org.onap.cps.spi.exceptions.SchemaSetNotFoundException
import org.onap.cps.spi.model.Dataspace
@@ -198,7 +199,7 @@ class SubscriptionModelLoaderSpec extends Specification {
def 'Create top level node fails due to an AlreadyDefined exception'() {
given: 'the saving of the node data will throw an Already Defined exception'
mockCpsDataService.saveData(*_) >>
- { throw AlreadyDefinedException.forDataNode('/xpath', "sampleContextName", null) }
+ { throw new AlreadyDefinedExceptionBatch(['/xpath']) }
when: 'the method to onboard model is called'
objectUnderTest.onboardSubscriptionModel(yangResourceToContentMap)
then: 'no exception thrown'