Refactor models for common type handling
[policy/models.git] / models-tosca / src / test / java / org / onap / policy / models / tosca / simple / provider / SimpleToscaProviderTest.java
index a926ca1..07624ae 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2019-2020 Nordix Foundation.
+ *  Copyright (C) 2019-2021 Nordix Foundation.
  *  Modifications Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -400,13 +400,12 @@ public class SimpleToscaProviderTest {
 
         assertThatThrownBy(() -> {
             originalServiceTemplate.fromAuthorative(toscaServiceTemplate);
-        }).hasMessage("PolicyType type not specified, the type of the PolicyType for this policy must be "
-                + "specified in the type field");
+        }).hasMessage("Type not specified, the type of this TOSCA entity must be specified in the type field");
 
         toscaPolicy.setType("IDontExist");
         assertThatThrownBy(() -> {
             originalServiceTemplate.fromAuthorative(toscaServiceTemplate);
-        }).hasMessage("PolicyType version not specified, the version of the PolicyType for this policy must be "
+        }).hasMessage("Version not specified, the version of this TOSCA entity must be "
                 + "specified in the type_version field");
 
         toscaPolicy.setTypeVersion("hello");
@@ -420,7 +419,7 @@ public class SimpleToscaProviderTest {
         assertThatThrownBy(() -> {
             new SimpleToscaProvider().createPolicies(pfDao, originalServiceTemplate);
         }).hasMessageContaining("policy type").hasMessageContaining("IDontExist:99.100.101")
-                        .hasMessageContaining(Validated.NOT_FOUND);
+                .hasMessageContaining(Validated.NOT_FOUND);
 
         toscaPolicy.setType("IDontExist");
         originalServiceTemplate.fromAuthorative(toscaServiceTemplate);
@@ -429,8 +428,7 @@ public class SimpleToscaProviderTest {
 
         assertThatThrownBy(() -> {
             originalServiceTemplate.fromAuthorative(toscaServiceTemplate);
-        }).hasMessage("PolicyType type not specified, the type of the PolicyType for this policy must be "
-                + "specified in the type field");
+        }).hasMessage("Type not specified, the type of this TOSCA entity must be specified in the type field");
 
         toscaPolicy.setType(originalPolicyType);
         toscaPolicy.setTypeVersion(originalPolicyTypeVersion);
@@ -525,8 +523,8 @@ public class SimpleToscaProviderTest {
         serviceTemplateFragment.getPolicyTypes().getConceptMap().put(badPt.getKey(), badPt);
 
         assertThatThrownBy(() -> new SimpleToscaProvider().appendToServiceTemplate(pfDao, serviceTemplateFragment))
-                        .hasMessageContaining("key on concept entry").hasMessageContaining("NULL:0.0.0")
-                        .hasMessageContaining(Validated.IS_A_NULL_KEY);
+                .hasMessageContaining("key on concept entry").hasMessageContaining("NULL:0.0.0")
+                .hasMessageContaining(Validated.IS_A_NULL_KEY);
     }
 
     @Test