diff options
author | 2024-12-03 18:29:25 +0000 | |
---|---|---|
committer | 2024-12-03 18:29:25 +0000 | |
commit | c2f92e45a7bcc7c7309ce37e2624c7cf2422594b (patch) | |
tree | 59a58ed6655ccd82d0f7888a0b639c927ecf1e92 /cps-ncmp-service | |
parent | f6e61f53ddc39a4f71521de4857e8303e238af6e (diff) |
Improve test coverage trustlevel manager
Issue-ID: CPS-475
Change-Id: I572227b4f6c61bd2286d8cb3fb85c3dc21142a47
Signed-off-by: ToineSiebelink <toine.siebelink@est.tech>
Diffstat (limited to 'cps-ncmp-service')
-rw-r--r-- | cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/inventory/trustlevel/TrustLevelManagerSpec.groovy | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/inventory/trustlevel/TrustLevelManagerSpec.groovy b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/inventory/trustlevel/TrustLevelManagerSpec.groovy index 4f41f2cbb1..bf79fe35d3 100644 --- a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/inventory/trustlevel/TrustLevelManagerSpec.groovy +++ b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/inventory/trustlevel/TrustLevelManagerSpec.groovy @@ -209,13 +209,16 @@ class TrustLevelManagerSpec extends Specification { assert ncmpServiceCmHandle.currentTrustLevel == TrustLevel.NONE } - def 'CmHandle trust level removed'() { - given: 'a cm handle' + def 'Removing cm Handle ids from trust level cache.'() { + given: 'a cm handle id with trustlevel in the cache' trustLevelPerCmHandleId.put('ch-1', TrustLevel.COMPLETE) - when: 'the remove is handled' - objectUnderTest.removeCmHandles(['ch-1']) - then: 'cm handle removed from the cache' - assert trustLevelPerCmHandleId.get('ch-1') == null + when: 'remove existing and non-existing cm handle ids' + objectUnderTest.removeCmHandles(['non-existing-id','ch-1']) + then: 'both cm handle ids are not included in the cache' + assert !trustLevelPerCmHandleId.contains('non-existing-id') + assert !trustLevelPerCmHandleId.contains('ch-1') + and: 'removing the non-existing id did not cause an exception' + noExceptionThrown() } } |