X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=models-tosca%2Fsrc%2Ftest%2Fjava%2Forg%2Fonap%2Fpolicy%2Fmodels%2Ftosca%2Fsimple%2Fconcepts%2FJpaToscaServiceTemplatesTest.java;h=a019a9727379c78acde6a62b0243f8202efa142c;hb=9c5d23395918a739b591667edd77e3ced9cd4bfb;hp=354fe8b78e553c4a18f2e8f0cdc31fdba7d57ec3;hpb=891bffd9f13177d96ad26acdfa7148d09e1d682a;p=policy%2Fmodels.git diff --git a/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaServiceTemplatesTest.java b/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaServiceTemplatesTest.java index 354fe8b78..a019a9727 100644 --- a/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaServiceTemplatesTest.java +++ b/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaServiceTemplatesTest.java @@ -1,6 +1,7 @@ /*- * ============LICENSE_START======================================================= - * Copyright (C) 2019 Nordix Foundation. + * Copyright (C) 2019-2020 Nordix Foundation. + * Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,15 +29,14 @@ import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.TreeMap; - import org.junit.Test; import org.onap.policy.models.base.PfConceptKey; import org.onap.policy.models.tosca.authorative.concepts.ToscaServiceTemplate; -import org.onap.policy.models.tosca.simple.concepts.JpaToscaServiceTemplate; -import org.onap.policy.models.tosca.simple.concepts.JpaToscaServiceTemplates; public class JpaToscaServiceTemplatesTest { + private static final String KEY_IS_NULL = "key is marked .*on.*ull but is null"; + @Test public void testServiceTemplates() { assertNotNull(new JpaToscaServiceTemplates()); @@ -47,23 +47,23 @@ public class JpaToscaServiceTemplatesTest { assertThatThrownBy(() -> { new JpaToscaServiceTemplates((PfConceptKey) null); - }).hasMessage("key is marked @NonNull but is null"); + }).hasMessageMatching(KEY_IS_NULL); assertThatThrownBy(() -> { new JpaToscaServiceTemplates((JpaToscaServiceTemplates) null); - }).hasMessage("copyConcept is marked @NonNull but is null"); + }).hasMessageMatching("copyConcept is marked .*on.*ull but is null"); assertThatThrownBy(() -> { new JpaToscaServiceTemplates(null, null); - }).hasMessage("key is marked @NonNull but is null"); + }).hasMessageMatching(KEY_IS_NULL); assertThatThrownBy(() -> { new JpaToscaServiceTemplates(new PfConceptKey(), null); - }).hasMessage("conceptMap is marked @NonNull but is null"); + }).hasMessageMatching("conceptMap is marked .*on.*ull but is null"); assertThatThrownBy(() -> { new JpaToscaServiceTemplates(null, new TreeMap()); - }).hasMessage("key is marked @NonNull but is null"); + }).hasMessageMatching(KEY_IS_NULL); List> tsMapList = new ArrayList<>(); tsMapList.add(new LinkedHashMap<>());