Changes for Checkstyle 8.32
[policy/models.git] / models-tosca / src / test / java / org / onap / policy / models / tosca / simple / concepts / JpaToscaServiceTemplatesTest.java
index 354fe8b..a019a97 100644 (file)
@@ -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<PfConceptKey, JpaToscaServiceTemplate>());
-        }).hasMessage("key is marked @NonNull but is null");
+        }).hasMessageMatching(KEY_IS_NULL);
 
         List<Map<String, ToscaServiceTemplate>> tsMapList = new ArrayList<>();
         tsMapList.add(new LinkedHashMap<>());