diff options
author | 2024-04-16 11:44:13 +0100 | |
---|---|---|
committer | 2024-04-16 15:21:46 +0100 | |
commit | 519334f314bd68085148a83dca0f5172276884df (patch) | |
tree | 33ad97ca18e25149d804665bc8df45bfe9da620a /models/src/test/java/org/onap/policy/clamp/models/acm/utils/AcmUtilsTest.java | |
parent | 32bc41230740115ec079f3780820bbd5ae07e6d3 (diff) |
Fix AutomationCompositionElement copy constructor
Issue-ID: POLICY-4961
Change-Id: I81256e2b0ecb82e7b313ad8b203b1bcf4468dd72
Signed-off-by: FrancescoFioraEst <francesco.fiora@est.tech>
Diffstat (limited to 'models/src/test/java/org/onap/policy/clamp/models/acm/utils/AcmUtilsTest.java')
-rw-r--r-- | models/src/test/java/org/onap/policy/clamp/models/acm/utils/AcmUtilsTest.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/models/src/test/java/org/onap/policy/clamp/models/acm/utils/AcmUtilsTest.java b/models/src/test/java/org/onap/policy/clamp/models/acm/utils/AcmUtilsTest.java index 1561533e8..a5c93e86a 100644 --- a/models/src/test/java/org/onap/policy/clamp/models/acm/utils/AcmUtilsTest.java +++ b/models/src/test/java/org/onap/policy/clamp/models/acm/utils/AcmUtilsTest.java @@ -24,6 +24,7 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -363,4 +364,16 @@ class AcmUtilsTest { assertNull(subMap.get("myParameterToRemove")); assertEquals("I am new", subMap.get("myParameter")); } + + @Test + void testCopyMap() { + Map<String, Object> map = new HashMap<>(); + Map<String, Object> subMap = new HashMap<>(); + subMap.put("test", "value"); + map.put("sub", subMap); + var result = AcmUtils.cloneMap(map); + var subMap2 = (Map<String, Object>) result.get("sub"); + subMap2.put("test", "value2"); + assertNotEquals(subMap.get("test"), subMap2.get("test")); + } } |