From 78ddc60ff79dd3f84c161194316665b3a0b791ac Mon Sep 17 00:00:00 2001 From: danielhanrahan Date: Mon, 26 Jan 2026 16:38:21 +0000 Subject: [PATCH] Fix non-null messages used in tests Many tests are needlessly using regular expressions like: "Object is marked .*on.*ull but is null" instead of: "Object is marked non-null but is null" Issue-ID: POLICY-5509 Change-Id: Ic6d0fa32058d68b74075986ca98cfbc8197076d3 Signed-off-by: danielhanrahan --- .../concepts/JpaAutomationCompositionElementTest.java | 6 +++--- .../concepts/JpaAutomationCompositionRollbackTest.java | 4 ++-- .../concepts/JpaAutomationCompositionTest.java | 4 ++-- .../acm/persistence/concepts/JpaMessageJobTest.java | 4 ++-- .../models/acm/persistence/concepts/JpaMessageTest.java | 8 ++++---- .../persistence/concepts/JpaParticipantReplicaTest.java | 4 ++-- .../concepts/JpaParticipantSupportedElementTypeTest.java | 10 +++++----- .../acm/persistence/concepts/JpaParticipantTest.java | 14 +++++++------- .../persistence/provider/ParticipantProviderTest.java | 2 +- .../clamp/models/acm/utils/StateDefinitionTest.java | 6 +++--- .../org/onap/policy/models/base/PfConceptKeyTest.java | 6 +++--- .../java/org/onap/policy/models/base/PfKeyImplTest.java | 16 ++++++++-------- .../authorative/concepts/ToscaNodeTemplateTest.java | 2 +- .../tosca/authorative/concepts/ToscaPolicyTest.java | 2 +- .../tosca/authorative/concepts/ToscaPolicyTypeTest.java | 2 +- .../authorative/concepts/ToscaServiceTemplateTest.java | 2 +- .../authorative/concepts/ToscaTopologyTemplateTest.java | 2 +- 17 files changed, 47 insertions(+), 47 deletions(-) diff --git a/models/src/test/java/org/onap/policy/clamp/models/acm/persistence/concepts/JpaAutomationCompositionElementTest.java b/models/src/test/java/org/onap/policy/clamp/models/acm/persistence/concepts/JpaAutomationCompositionElementTest.java index 62d3ada22..d25dd45e0 100644 --- a/models/src/test/java/org/onap/policy/clamp/models/acm/persistence/concepts/JpaAutomationCompositionElementTest.java +++ b/models/src/test/java/org/onap/policy/clamp/models/acm/persistence/concepts/JpaAutomationCompositionElementTest.java @@ -44,9 +44,9 @@ import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier; */ class JpaAutomationCompositionElementTest { - private static final String NULL_INSTANCE_ID_ERROR = "instanceId is marked .*ull but is null"; - private static final String NULL_ELEMENT_ID_ERROR = "elementId is marked .*ull but is null"; - private static final String NULL_ERROR = " is marked .*ull but is null"; + private static final String NULL_INSTANCE_ID_ERROR = "instanceId is marked non-null but is null"; + private static final String NULL_ELEMENT_ID_ERROR = "elementId is marked non-null but is null"; + private static final String NULL_ERROR = " is marked non-null but is null"; private static final String ELEMENT_ID = "a95757ba-b34a-4049-a2a8-46773abcbe5e"; private static final String INSTANCE_ID = "a78757co-b34a-8949-a2a8-46773abcbe2a"; private static final String KEY = "key"; diff --git a/models/src/test/java/org/onap/policy/clamp/models/acm/persistence/concepts/JpaAutomationCompositionRollbackTest.java b/models/src/test/java/org/onap/policy/clamp/models/acm/persistence/concepts/JpaAutomationCompositionRollbackTest.java index 6079b7ed5..eeee448d7 100644 --- a/models/src/test/java/org/onap/policy/clamp/models/acm/persistence/concepts/JpaAutomationCompositionRollbackTest.java +++ b/models/src/test/java/org/onap/policy/clamp/models/acm/persistence/concepts/JpaAutomationCompositionRollbackTest.java @@ -32,8 +32,8 @@ import org.onap.policy.clamp.models.acm.concepts.AutomationCompositionRollback; class JpaAutomationCompositionRollbackTest { - private static final String NULL_INSTANCE_ID_ERROR = "instanceId is marked .*ull but is null"; - private static final String NULL_ERROR = " is marked .*ull but is null"; + private static final String NULL_INSTANCE_ID_ERROR = "instanceId is marked non-null but is null"; + private static final String NULL_ERROR = " is marked non-null but is null"; private static final String INSTANCE_ID = "709c62b3-8918-41b9-a747-d21eb79c6c20"; private static final String COMPOSITION_ID = "709c62b3-8918-41b9-a747-e21eb79c6c41"; diff --git a/models/src/test/java/org/onap/policy/clamp/models/acm/persistence/concepts/JpaAutomationCompositionTest.java b/models/src/test/java/org/onap/policy/clamp/models/acm/persistence/concepts/JpaAutomationCompositionTest.java index 7a8dda0f2..e31049445 100644 --- a/models/src/test/java/org/onap/policy/clamp/models/acm/persistence/concepts/JpaAutomationCompositionTest.java +++ b/models/src/test/java/org/onap/policy/clamp/models/acm/persistence/concepts/JpaAutomationCompositionTest.java @@ -43,7 +43,7 @@ import org.onap.policy.clamp.models.acm.utils.TimestampHelper; * Test the{@link JpaAutomationCompositionTest} class. */ class JpaAutomationCompositionTest { - private static final String NULL_ERROR = " is marked .*ull but is null"; + private static final String NULL_ERROR = " is marked non-null but is null"; private static final String INSTANCE_ID = "709c62b3-8918-41b9-a747-d21eb79c6c20"; private static final String COMPOSITION_ID = "709c62b3-8918-41b9-a747-e21eb79c6c41"; @@ -95,7 +95,7 @@ class JpaAutomationCompositionTest { var testJpaAutomationComposition = new JpaAutomationComposition(createAutomationCompositionInstance()); assertThatThrownBy(() -> testJpaAutomationComposition.validate(null)) - .hasMessageMatching("fieldName is marked .*ull but is null"); + .hasMessageMatching("fieldName is marked non-null but is null"); assertTrue(testJpaAutomationComposition.validate("").isValid()); } diff --git a/models/src/test/java/org/onap/policy/clamp/models/acm/persistence/concepts/JpaMessageJobTest.java b/models/src/test/java/org/onap/policy/clamp/models/acm/persistence/concepts/JpaMessageJobTest.java index bf673bed5..c8bc561fe 100644 --- a/models/src/test/java/org/onap/policy/clamp/models/acm/persistence/concepts/JpaMessageJobTest.java +++ b/models/src/test/java/org/onap/policy/clamp/models/acm/persistence/concepts/JpaMessageJobTest.java @@ -32,7 +32,7 @@ class JpaMessageJobTest { @Test void testJpaMessageJobConstructor() { assertThatThrownBy(() -> new JpaMessageJob(null)) - .hasMessageMatching("identificationId is marked .*ull but is null"); + .hasMessageMatching("identificationId is marked non-null but is null"); } @Test @@ -40,7 +40,7 @@ class JpaMessageJobTest { var jpaMessageJob = new JpaMessageJob(); assertThatThrownBy(() -> jpaMessageJob.validate(null)) - .hasMessageMatching("fieldName is marked .*ull but is null"); + .hasMessageMatching("fieldName is marked non-null but is null"); assertTrue(jpaMessageJob.validate("").isValid()); diff --git a/models/src/test/java/org/onap/policy/clamp/models/acm/persistence/concepts/JpaMessageTest.java b/models/src/test/java/org/onap/policy/clamp/models/acm/persistence/concepts/JpaMessageTest.java index f9a19c408..0e091ec36 100644 --- a/models/src/test/java/org/onap/policy/clamp/models/acm/persistence/concepts/JpaMessageTest.java +++ b/models/src/test/java/org/onap/policy/clamp/models/acm/persistence/concepts/JpaMessageTest.java @@ -36,9 +36,9 @@ class JpaMessageTest { @Test void testJpaMessageConstructor() { assertThatThrownBy(() -> new JpaMessage(null, new DocMessage())) - .hasMessageMatching("identificationId is marked .*ull but is null"); + .hasMessageMatching("identificationId is marked non-null but is null"); assertThatThrownBy(() -> new JpaMessage(UUID.randomUUID().toString(), null)) - .hasMessageMatching("docMessage is marked .*ull but is null"); + .hasMessageMatching("docMessage is marked non-null but is null"); } @Test @@ -47,7 +47,7 @@ class JpaMessageTest { var jpaMessage = new JpaMessage(docMessage.getInstanceId().toString(), docMessage); assertThatThrownBy(() -> jpaMessage.validate(null)) - .hasMessageMatching("fieldName is marked .*ull but is null"); + .hasMessageMatching("fieldName is marked non-null but is null"); assertTrue(jpaMessage.validate("").isValid()); @@ -64,7 +64,7 @@ class JpaMessageTest { assertEquals(docMessage, jpaMessage.toAuthorative()); assertThatThrownBy(() -> jpaMessage.fromAuthorative(null)) - .hasMessageMatching("docMessage is marked .*ull but is null"); + .hasMessageMatching("docMessage is marked non-null but is null"); assertThatThrownBy(() -> new JpaMessage((JpaMessage) null)).isInstanceOf(NullPointerException.class); diff --git a/models/src/test/java/org/onap/policy/clamp/models/acm/persistence/concepts/JpaParticipantReplicaTest.java b/models/src/test/java/org/onap/policy/clamp/models/acm/persistence/concepts/JpaParticipantReplicaTest.java index 4f48c664a..cac9afa6a 100644 --- a/models/src/test/java/org/onap/policy/clamp/models/acm/persistence/concepts/JpaParticipantReplicaTest.java +++ b/models/src/test/java/org/onap/policy/clamp/models/acm/persistence/concepts/JpaParticipantReplicaTest.java @@ -35,10 +35,10 @@ class JpaParticipantReplicaTest { @Test void testJpaParticipantReplicaConstructor() { assertThatThrownBy(() -> new JpaParticipantReplica(UUID.randomUUID().toString(), null)) - .hasMessageMatching("participantId is marked .*ull but is null"); + .hasMessageMatching("participantId is marked non-null but is null"); assertThatThrownBy(() -> new JpaParticipantReplica(null, UUID.randomUUID().toString())) - .hasMessageMatching("replicaId is marked .*ull but is null"); + .hasMessageMatching("replicaId is marked non-null but is null"); assertDoesNotThrow(() -> new JpaParticipantReplica(UUID.randomUUID().toString(), UUID.randomUUID().toString())); } diff --git a/models/src/test/java/org/onap/policy/clamp/models/acm/persistence/concepts/JpaParticipantSupportedElementTypeTest.java b/models/src/test/java/org/onap/policy/clamp/models/acm/persistence/concepts/JpaParticipantSupportedElementTypeTest.java index 6bd25bb9a..68a60a92b 100644 --- a/models/src/test/java/org/onap/policy/clamp/models/acm/persistence/concepts/JpaParticipantSupportedElementTypeTest.java +++ b/models/src/test/java/org/onap/policy/clamp/models/acm/persistence/concepts/JpaParticipantSupportedElementTypeTest.java @@ -34,9 +34,9 @@ import org.onap.policy.clamp.models.acm.concepts.ParticipantSupportedElementType */ class JpaParticipantSupportedElementTypeTest { - private static final String NULL_PARTICIPANT_ID_ERROR = "participantId is marked .*ull but is null"; - private static final String NULL_ID_ERROR = "id is marked .*ull but is null"; - private static final String NULL_ERROR = " is marked .*ull but is null"; + private static final String NULL_PARTICIPANT_ID_ERROR = "participantId is marked non-null but is null"; + private static final String NULL_ID_ERROR = "id is marked non-null but is null"; + private static final String NULL_ERROR = " is marked non-null but is null"; private static final String ID = "a95757ba-b34a-4049-a2a8-46773abcbe5e"; private static final String PARTICIPANT_ID = "a78757co-b34a-8949-a2a8-46773abcbe2a"; @@ -44,7 +44,7 @@ class JpaParticipantSupportedElementTypeTest { void testJpaAutomationCompositionElementConstructor() { assertThatThrownBy(() -> { new JpaParticipantSupportedElementType((JpaParticipantSupportedElementType) null); - }).hasMessageMatching("copyConcept is marked .*ull but is null"); + }).hasMessageMatching("copyConcept is marked non-null but is null"); assertThatThrownBy(() -> { new JpaParticipantSupportedElementType("key", null); @@ -90,7 +90,7 @@ class JpaParticipantSupportedElementTypeTest { assertThatThrownBy(() -> { testJpaSupportElement.fromAuthorative(null); - }).hasMessageMatching("participantSupportedElementType is marked .*ull but is null"); + }).hasMessageMatching("participantSupportedElementType is marked non-null but is null"); assertThatThrownBy(() -> new JpaParticipantSupportedElementType((JpaParticipantSupportedElementType) null)) .isInstanceOf(NullPointerException.class); diff --git a/models/src/test/java/org/onap/policy/clamp/models/acm/persistence/concepts/JpaParticipantTest.java b/models/src/test/java/org/onap/policy/clamp/models/acm/persistence/concepts/JpaParticipantTest.java index ceca60f2d..4c2ac0ebf 100644 --- a/models/src/test/java/org/onap/policy/clamp/models/acm/persistence/concepts/JpaParticipantTest.java +++ b/models/src/test/java/org/onap/policy/clamp/models/acm/persistence/concepts/JpaParticipantTest.java @@ -38,24 +38,24 @@ import org.onap.policy.clamp.models.acm.concepts.Participant; */ class JpaParticipantTest { - private static final String NULL_KEY_ERROR = "participantId is marked .*ull but is null"; + private static final String NULL_KEY_ERROR = "participantId is marked non-null but is null"; @Test void testJpaParticipantConstructor() { assertThatThrownBy(() -> new JpaParticipant((Participant) null)) - .hasMessageMatching("authorativeConcept is marked .*ull but is null"); + .hasMessageMatching("authorativeConcept is marked non-null but is null"); assertThatThrownBy(() -> new JpaParticipant((JpaParticipant) null)) - .hasMessageMatching("copyConcept is marked .*ull but is null"); + .hasMessageMatching("copyConcept is marked non-null but is null"); assertThatThrownBy(() -> new JpaParticipant(null, new ArrayList<>(), new ArrayList<>())) .hasMessageMatching(NULL_KEY_ERROR); assertThatThrownBy(() -> new JpaParticipant(UUID.randomUUID().toString(), null, new ArrayList<>())) - .hasMessageMatching("supportedElements is marked .*ull but is null"); + .hasMessageMatching("supportedElements is marked non-null but is null"); assertThatThrownBy(() -> new JpaParticipant(UUID.randomUUID().toString(), new ArrayList<>(), null)) - .hasMessageMatching("replicas is marked .*ull but is null"); + .hasMessageMatching("replicas is marked non-null but is null"); assertDoesNotThrow(() -> new JpaParticipant(UUID.randomUUID().toString(), new ArrayList<>(), new ArrayList<>())); @@ -69,7 +69,7 @@ class JpaParticipantTest { assertEquals(participant, testJpaParticipant.toAuthorative()); assertThatThrownBy(() -> testJpaParticipant.fromAuthorative(null)) - .hasMessageMatching("participant is marked .*ull but is null"); + .hasMessageMatching("participant is marked non-null but is null"); assertThatThrownBy(() -> new JpaParticipant((JpaParticipant) null)).isInstanceOf(NullPointerException.class); @@ -88,7 +88,7 @@ class JpaParticipantTest { var testJpaParticipant = new JpaParticipant(createParticipantInstance()); assertThatThrownBy(() -> testJpaParticipant.validate(null)) - .hasMessageMatching("fieldName is marked .*ull but is null"); + .hasMessageMatching("fieldName is marked non-null but is null"); assertTrue(testJpaParticipant.validate("").isValid()); } diff --git a/models/src/test/java/org/onap/policy/clamp/models/acm/persistence/provider/ParticipantProviderTest.java b/models/src/test/java/org/onap/policy/clamp/models/acm/persistence/provider/ParticipantProviderTest.java index 7df50ad30..b3dbb046e 100644 --- a/models/src/test/java/org/onap/policy/clamp/models/acm/persistence/provider/ParticipantProviderTest.java +++ b/models/src/test/java/org/onap/policy/clamp/models/acm/persistence/provider/ParticipantProviderTest.java @@ -69,7 +69,7 @@ class ParticipantProviderTest { "src/test/resources/providers/TestAutomationCompositions.json"; private static final String NODE_TEMPLATE_STATE_JSON = "src/test/resources/providers/NodeTemplateState.json"; - private static final String LIST_IS_NULL = ".*. is marked .*ull but is null"; + private static final String LIST_IS_NULL = ".*. is marked non-null but is null"; private static final UUID INVALID_ID = UUID.randomUUID(); private final List inputParticipants = new ArrayList<>(); diff --git a/models/src/test/java/org/onap/policy/clamp/models/acm/utils/StateDefinitionTest.java b/models/src/test/java/org/onap/policy/clamp/models/acm/utils/StateDefinitionTest.java index c2cbf4bbc..186e6be56 100644 --- a/models/src/test/java/org/onap/policy/clamp/models/acm/utils/StateDefinitionTest.java +++ b/models/src/test/java/org/onap/policy/clamp/models/acm/utils/StateDefinitionTest.java @@ -30,11 +30,11 @@ class StateDefinitionTest { void testNonNull() { var stateDefinition = new StateDefinition(2, null); assertThatThrownBy(() -> stateDefinition.put(null, null)) - .hasMessageMatching("keys is marked .*ull but is null"); + .hasMessageMatching("keys is marked non-null but is null"); assertThatThrownBy(() -> stateDefinition.put(new String[] {"", ""}, null)) - .hasMessageMatching("value is marked .*ull but is null"); + .hasMessageMatching("value is marked non-null but is null"); assertThatThrownBy(() -> stateDefinition.get(null)) - .hasMessageMatching("keys is marked .*ull but is null"); + .hasMessageMatching("keys is marked non-null but is null"); } @Test diff --git a/policy-models/src/test/java/org/onap/policy/models/base/PfConceptKeyTest.java b/policy-models/src/test/java/org/onap/policy/models/base/PfConceptKeyTest.java index 4c8dfc3f3..753cbe44a 100644 --- a/policy-models/src/test/java/org/onap/policy/models/base/PfConceptKeyTest.java +++ b/policy-models/src/test/java/org/onap/policy/models/base/PfConceptKeyTest.java @@ -32,7 +32,7 @@ import org.junit.jupiter.api.Test; class PfConceptKeyTest { private static final String VERSION001 = "0.0.1"; - private static final String ID_IS_NULL = "id is marked .*on.*ull but is null$"; + private static final String ID_IS_NULL = "id is marked non-null but is null$"; @Test void testConceptKey() { @@ -66,10 +66,10 @@ class PfConceptKeyTest { assertThatThrownBy(() -> PfConceptKey.getNullKey().matchesId(null)).hasMessageMatching(ID_IS_NULL); assertThatThrownBy(() -> someKey0.setName(null)).isInstanceOf(NullPointerException.class) - .hasMessageMatching("^name is marked .*on.*ull but is null$"); + .hasMessageMatching("^name is marked non-null but is null$"); assertThatThrownBy(() -> someKey0.setVersion(null)).isInstanceOf(NullPointerException.class) - .hasMessageMatching("^version is marked .*on.*ull but is null$"); + .hasMessageMatching("^version is marked non-null but is null$"); assertThatIllegalArgumentException().isThrownBy(() -> new PfConceptKey("my-name.*", VERSION001)).withMessage( "parameter 'name': value 'my-name.*', does not match regular expression '^[A-Za-z0-9\\-_\\.]+$'" diff --git a/policy-models/src/test/java/org/onap/policy/models/base/PfKeyImplTest.java b/policy-models/src/test/java/org/onap/policy/models/base/PfKeyImplTest.java index 83e38e341..df7b5bc53 100644 --- a/policy-models/src/test/java/org/onap/policy/models/base/PfKeyImplTest.java +++ b/policy-models/src/test/java/org/onap/policy/models/base/PfKeyImplTest.java @@ -43,7 +43,7 @@ import org.onap.policy.models.base.PfKey.Compatibility; class PfKeyImplTest { - private static final String ID_IS_NULL = "^id is marked .*on.*ull but is null$"; + private static final String ID_IS_NULL = "^id is marked non-null but is null$"; private static final String VERSION001 = "0.0.1"; private static final String NAME = "name"; private static MyKey someKey; @@ -97,7 +97,7 @@ class PfKeyImplTest { + PfKey.KEY_ID_REGEXP + "\""); assertThatThrownBy(() -> new MyKey((MyKey) null)) - .hasMessageMatching("^copyConcept is marked .*on.*ull but is null$"); + .hasMessageMatching("^copyConcept is marked non-null but is null$"); assertTrue(someKey.isNullKey()); assertEquals(new MyKey(PfKey.NULL_KEY_NAME, PfKey.NULL_KEY_VERSION), someKey); @@ -119,7 +119,7 @@ class PfKeyImplTest { assertEquals("name:0.1.2", someKey4.getId()); assertThatThrownBy(() -> someKey0.getCompatibility(null)).isInstanceOf(NullPointerException.class) - .hasMessageMatching("^otherKey is marked .*on.*ull but is null$"); + .hasMessageMatching("^otherKey is marked non-null but is null$"); assertEquals(Compatibility.DIFFERENT, someKey0.getCompatibility(new PfConceptKey())); assertEquals(Compatibility.DIFFERENT, buildKey1.getCompatibility(new PfConceptKey())); @@ -163,7 +163,7 @@ class PfKeyImplTest { assertEquals(-12, someKey7.compareTo(someKey0)); assertThatThrownBy(() -> someKey0.compareTo(null)).isInstanceOf(NullPointerException.class) - .hasMessageMatching("^otherObj is marked .*on.*ull but is null$"); + .hasMessageMatching("^otherObj is marked non-null but is null$"); assertEquals(0, someKey0.compareTo(someKey0)); assertNotEquals(0, someKey0.compareTo(new PfConceptKey())); @@ -178,15 +178,15 @@ class PfKeyImplTest { assertThatThrownBy(() -> new MyKey((String) null)).hasMessageMatching(ID_IS_NULL); assertThatThrownBy(() -> new MyKey((MyKey) null)) - .hasMessageMatching("^copyConcept is marked .*on.*ull but is null$"); + .hasMessageMatching("^copyConcept is marked non-null but is null$"); - assertThatThrownBy(() -> new MyKey(null, null)).hasMessageMatching("name is marked .*on.*ull but is null$"); + assertThatThrownBy(() -> new MyKey(null, null)).hasMessageMatching("name is marked non-null but is null$"); assertThatThrownBy(() -> new MyKey(NAME, null)) - .hasMessageMatching("^version is marked .*on.*ull but is null$"); + .hasMessageMatching("^version is marked non-null but is null$"); assertThatThrownBy(() -> new MyKey(null, VERSION001)) - .hasMessageMatching("^name is marked .*on.*ull but is null$"); + .hasMessageMatching("^name is marked non-null but is null$"); } @Test diff --git a/policy-models/src/test/java/org/onap/policy/models/tosca/authorative/concepts/ToscaNodeTemplateTest.java b/policy-models/src/test/java/org/onap/policy/models/tosca/authorative/concepts/ToscaNodeTemplateTest.java index 58474b374..6d0d32a26 100644 --- a/policy-models/src/test/java/org/onap/policy/models/tosca/authorative/concepts/ToscaNodeTemplateTest.java +++ b/policy-models/src/test/java/org/onap/policy/models/tosca/authorative/concepts/ToscaNodeTemplateTest.java @@ -35,7 +35,7 @@ class ToscaNodeTemplateTest { void testToscaNodeTemplate() { assertThatThrownBy(() -> { new ToscaNodeTemplate(null); - }).hasMessageMatching("copyObject is marked .*on.*ull but is null"); + }).hasMessageMatching("copyObject is marked non-null but is null"); assertNotNull(new ToscaNodeTemplate(new ToscaNodeTemplate())); diff --git a/policy-models/src/test/java/org/onap/policy/models/tosca/authorative/concepts/ToscaPolicyTest.java b/policy-models/src/test/java/org/onap/policy/models/tosca/authorative/concepts/ToscaPolicyTest.java index 123ed93d5..38f00d140 100644 --- a/policy-models/src/test/java/org/onap/policy/models/tosca/authorative/concepts/ToscaPolicyTest.java +++ b/policy-models/src/test/java/org/onap/policy/models/tosca/authorative/concepts/ToscaPolicyTest.java @@ -37,7 +37,7 @@ class ToscaPolicyTest { void testGetIdentifier_testGetTypeIdentifier() { assertThatThrownBy(() -> { new ToscaPolicy(null); - }).hasMessageMatching("copyObject is marked .*on.*ull but is null"); + }).hasMessageMatching("copyObject is marked non-null but is null"); ToscaPolicy policy = new ToscaPolicy(); diff --git a/policy-models/src/test/java/org/onap/policy/models/tosca/authorative/concepts/ToscaPolicyTypeTest.java b/policy-models/src/test/java/org/onap/policy/models/tosca/authorative/concepts/ToscaPolicyTypeTest.java index 148cf8a2d..350725f93 100644 --- a/policy-models/src/test/java/org/onap/policy/models/tosca/authorative/concepts/ToscaPolicyTypeTest.java +++ b/policy-models/src/test/java/org/onap/policy/models/tosca/authorative/concepts/ToscaPolicyTypeTest.java @@ -38,7 +38,7 @@ class ToscaPolicyTypeTest { void testToscaPolicyType() { assertThatThrownBy(() -> { new ToscaPolicyType(null); - }).hasMessageMatching("copyObject is marked .*on.*ull but is null"); + }).hasMessageMatching("copyObject is marked non-null but is null"); ToscaPolicyType tpt = new ToscaPolicyType(); tpt.setName("AType"); diff --git a/policy-models/src/test/java/org/onap/policy/models/tosca/authorative/concepts/ToscaServiceTemplateTest.java b/policy-models/src/test/java/org/onap/policy/models/tosca/authorative/concepts/ToscaServiceTemplateTest.java index b11b8a60d..c6ca6ea1d 100644 --- a/policy-models/src/test/java/org/onap/policy/models/tosca/authorative/concepts/ToscaServiceTemplateTest.java +++ b/policy-models/src/test/java/org/onap/policy/models/tosca/authorative/concepts/ToscaServiceTemplateTest.java @@ -34,7 +34,7 @@ class ToscaServiceTemplateTest { void testToscServiceTemplate() { assertThatThrownBy(() -> { new ToscaServiceTemplate(null); - }).hasMessageMatching("copyObject is marked .*on.*ull but is null"); + }).hasMessageMatching("copyObject is marked non-null but is null"); assertNotNull(new ToscaServiceTemplate(new ToscaServiceTemplate())); diff --git a/policy-models/src/test/java/org/onap/policy/models/tosca/authorative/concepts/ToscaTopologyTemplateTest.java b/policy-models/src/test/java/org/onap/policy/models/tosca/authorative/concepts/ToscaTopologyTemplateTest.java index 398dfb1a9..1909f2e95 100644 --- a/policy-models/src/test/java/org/onap/policy/models/tosca/authorative/concepts/ToscaTopologyTemplateTest.java +++ b/policy-models/src/test/java/org/onap/policy/models/tosca/authorative/concepts/ToscaTopologyTemplateTest.java @@ -35,7 +35,7 @@ class ToscaTopologyTemplateTest { void testToscTopologyTemplate() { assertThatThrownBy(() -> { new ToscaTopologyTemplate(null); - }).hasMessageMatching("copyObject is marked .*on.*ull but is null"); + }).hasMessageMatching("copyObject is marked non-null but is null"); assertNotNull(new ToscaTopologyTemplate(new ToscaTopologyTemplate())); -- 2.16.6