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=1b323a216ef0a34fe89ced1e39c13b7a04e5c086;hb=814b882c6bf85a88c9135edb592e90d46af31f9a;hp=a625e3e464e9618de3163c68f01054d92b00a793;hpb=67681820f2a7fea88cbc6cbe5b3d483dae506d55;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 a625e3e46..1b323a216 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('cached 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('cached cmhandle id', 'other id')