X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=models-base%2Fsrc%2Ftest%2Fjava%2Forg%2Fonap%2Fpolicy%2Fmodels%2Fbase%2FPfConceptContainerTest.java;h=c526b231a6c759b05aff135eea43bf7fb4fbb5a3;hb=938005505883cf7a636a8840e20e3dc8a0ad9176;hp=f5c6e3a9b86b388980ab04fb6e08a38b27595751;hpb=24e47e99077ab0b7608fca68bd30a7bc70e766c2;p=policy%2Fmodels.git diff --git a/models-base/src/test/java/org/onap/policy/models/base/PfConceptContainerTest.java b/models-base/src/test/java/org/onap/policy/models/base/PfConceptContainerTest.java index f5c6e3a9b..c526b231a 100644 --- a/models-base/src/test/java/org/onap/policy/models/base/PfConceptContainerTest.java +++ b/models-base/src/test/java/org/onap/policy/models/base/PfConceptContainerTest.java @@ -1,6 +1,6 @@ /*- * ============LICENSE_START======================================================= - * Copyright (C) 2019-2021 Nordix Foundation. + * Copyright (C) 2019-2021, 2023 Nordix Foundation. * Modifications Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); @@ -65,18 +65,18 @@ public class PfConceptContainerTest { container = new DummyPfConceptContainer(new PfConceptKey()); assertNotNull(container); - container = new DummyPfConceptContainer(new PfConceptKey(), new TreeMap()); + container = new DummyPfConceptContainer(new PfConceptKey(), new TreeMap<>()); assertNotNull(container); - assertThatThrownBy(() -> new PfConceptContainer((PfConceptKey) null, null)).hasMessageMatching(KEY_IS_NULL); + assertThatThrownBy(() -> new PfConceptContainer(null, null)).hasMessageMatching(KEY_IS_NULL); - assertThatThrownBy(() -> new DummyPfConceptContainer((PfConceptKey) null, null)) + assertThatThrownBy(() -> new DummyPfConceptContainer(null, null)) .hasMessageMatching(KEY_IS_NULL); assertThatThrownBy(() -> new DummyPfConceptContainer(new PfConceptKey(), null)) .hasMessageMatching("^conceptMap is marked .*on.*ull but is null$"); - assertThatThrownBy(() -> new DummyPfConceptContainer(null, new TreeMap())) + assertThatThrownBy(() -> new DummyPfConceptContainer(null, new TreeMap<>())) .hasMessageMatching(KEY_IS_NULL); } @@ -117,8 +117,8 @@ public class PfConceptContainerTest { assertThatThrownBy(() -> new DummyPfConceptContainer((DummyPfConceptContainer) null)) .isInstanceOf(NullPointerException.class); + assertThatThrownBy(() -> container.compareTo(null)).isInstanceOf(NullPointerException.class); - assertNotEquals(0, container.compareTo(null)); assertEquals(0, container.compareTo(container)); assertNotEquals(0, container.compareTo(conceptKey)); @@ -271,7 +271,7 @@ public class PfConceptContainerTest { } @Test(expected = NullPointerException.class) - public void testnullKey() { + public void testNullKey() { PfConceptKey nullKey = null; new DummyPfConceptContainer(nullKey); }