aboutsummaryrefslogtreecommitdiffstats
path: root/cps-ncmp-service/src/test/groovy
diff options
context:
space:
mode:
authorToineSiebelink <toine.siebelink@est.tech>2025-01-21 13:35:03 +0000
committerToineSiebelink <toine.siebelink@est.tech>2025-01-21 15:45:22 +0000
commit6fb1e85fd1cdb20cb8f64f81c188c29c0391ab2a (patch)
treecb63a46363b1f3423c32e5d85958ec33abec8d37 /cps-ncmp-service/src/test/groovy
parent14745d17d3e751ead0817bfbc42acf5ee45e627f (diff)
Remove retry mechanism for duplicate module(resource) errors
- CM Handle with problems will go into 'LOCKED' state and retried using existing business logic Issue-ID: CPS-2555 Change-Id: I563f6bc536d8fd8c6675891c62318ff2fb43fea6 Signed-off-by: ToineSiebelink <toine.siebelink@est.tech>
Diffstat (limited to 'cps-ncmp-service/src/test/groovy')
-rw-r--r--cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/inventory/sync/ModuleSyncServiceSpec.groovy13
1 files changed, 7 insertions, 6 deletions
diff --git a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/inventory/sync/ModuleSyncServiceSpec.groovy b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/inventory/sync/ModuleSyncServiceSpec.groovy
index f8adfe5578..7881375762 100644
--- a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/inventory/sync/ModuleSyncServiceSpec.groovy
+++ b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/inventory/sync/ModuleSyncServiceSpec.groovy
@@ -90,20 +90,21 @@ class ModuleSyncServiceSpec extends Specification {
'without' | ''
}
- def 'Attempt Sync models for a cm handle with existing schema set (#exception).'() {
+ def 'Attempt Sync models for a cm handle with existing schema set (#originalException).'() {
given: 'a cm handle to be synced'
def yangModelCmHandle = createAdvisedCmHandle('existing tag')
and: 'dmi returns no new yang resources'
mockDmiModelOperations.getNewYangResourcesFromDmi(*_) >> [:]
and: 'already defined exception occurs when creating schema (existing)'
- mockCpsModuleService.createSchemaSetFromModules(*_) >> { throw exception }
+ mockCpsModuleService.createSchemaSetFromModules(*_) >> { throw originalException }
when: 'module sync is triggered'
objectUnderTest.syncAndCreateSchemaSetAndAnchor(yangModelCmHandle)
- then: 'no exception is thrown up'
- noExceptionThrown()
+ then: 'same exception is thrown up'
+ def thrownException = thrown(Exception)
+ assert thrownException == originalException
where: 'following exceptions occur'
- exception << [ AlreadyDefinedException.forSchemaSet('', '', null),
- new DuplicatedYangResourceException('', '', null) ]
+ originalException << [AlreadyDefinedException.forSchemaSet('', '', null),
+ new DuplicatedYangResourceException('', '', null) ]
}
def 'Model upgrade without using Module Set Tags (legacy) where the modules are in database.'() {