From: Toine Siebelink Date: Thu, 8 Feb 2024 10:48:23 +0000 (+0000) Subject: Merge "CmHandle delete is failing with InternalServerError: Null key is not allowed... X-Git-Tag: 3.4.4~35 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=02838ed3f79a57ed10af29e97979b02675646d51;hp=5defc2d9ceb8e5f029b009d517a3491e42e283dd;p=cps.git Merge "CmHandle delete is failing with InternalServerError: Null key is not allowed - add missing unit test" --- 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')