X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=cps-ncmp-service%2Fsrc%2Ftest%2Fgroovy%2Forg%2Fonap%2Fcps%2Fncmp%2Fapi%2Fimpl%2Futils%2FCmHandleIdMapperSpec.groovy;fp=cps-ncmp-service%2Fsrc%2Ftest%2Fgroovy%2Forg%2Fonap%2Fcps%2Fncmp%2Fapi%2Fimpl%2Futils%2FCmHandleIdMapperSpec.groovy;h=55ccdf3be571851a23e9b392705776985b2dcc41;hb=590a3ee140e06a979aaf49f55bb4f8e3c7ce8e17;hp=0a2962e98fabef04241a2cf1d68496b8a70ae3b4;hpb=e190adf9b0e8e0bb9e5012dd40b712c97e45c9de;p=cps.git diff --git a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/utils/CmHandleIdMapperSpec.groovy b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/utils/CmHandleIdMapperSpec.groovy index 0a2962e98..55ccdf3be 100644 --- a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/utils/CmHandleIdMapperSpec.groovy +++ b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/utils/CmHandleIdMapperSpec.groovy @@ -78,6 +78,15 @@ class CmHandleIdMapperSpec extends Specification { assert objectUnderTest.cmHandleIdToAlternateId('my cmhandle id') == null } + def 'Attempt to remove a non-existing entry from the cache.'() { + when: 'removing an entry that is not cached' + objectUnderTest.removeMapping('non-cached cmhandle id') + then: 'deleting from the cmhandle cache returns null' + assert alternateIdPerCmHandle.remove('non-cached cmhandle id') == null + and: 'removal from the alternate id cache is skipped' + 0 * cmHandlePerAlternateId.remove(_) + } + def 'Cannot update existing alternate id.'() { given: 'attempt to update an existing alternate id' objectUnderTest.addMapping('my cmhandle id', 'other id')