diff options
author | 2024-12-04 10:38:42 +0000 | |
---|---|---|
committer | 2024-12-04 10:38:42 +0000 | |
commit | 45c75e4716c4dd4575168d29016fba0b2fe3c50a (patch) | |
tree | e49a134b8ca439656fbff7e37b6cc89565b98f27 | |
parent | cf86c61470d6711d1e5cdffe7c202909cb02d992 (diff) | |
parent | c2f92e45a7bcc7c7309ce37e2624c7cf2422594b (diff) |
Merge "Improve test coverage trustlevel manager"
-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() } } |