aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/test/java/org/onap/policy/pap/main/service/ToscaServiceTemplateServiceTest.java
diff options
context:
space:
mode:
authorFrancescoFioraEst <francesco.fiora@est.tech>2023-11-22 16:57:25 +0000
committerFrancesco Fiora <francesco.fiora@est.tech>2023-11-27 10:56:53 +0000
commitd2f73c772bc6da457bbee2f5ee127d78e2f9f1f4 (patch)
tree494ce770d71fd2717f871fdb55897ffdc7989944 /main/src/test/java/org/onap/policy/pap/main/service/ToscaServiceTemplateServiceTest.java
parent42aa3913332e6e26cdbb327770c837e20ba7adb8 (diff)
Allow semantic versioning in all templates in pap
Issue-ID: POLICY-4887 Change-Id: Iccb46a19c1cb54d8a6b5b7df7294a2d715b2879e Signed-off-by: FrancescoFioraEst <francesco.fiora@est.tech>
Diffstat (limited to 'main/src/test/java/org/onap/policy/pap/main/service/ToscaServiceTemplateServiceTest.java')
-rw-r--r--main/src/test/java/org/onap/policy/pap/main/service/ToscaServiceTemplateServiceTest.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/main/src/test/java/org/onap/policy/pap/main/service/ToscaServiceTemplateServiceTest.java b/main/src/test/java/org/onap/policy/pap/main/service/ToscaServiceTemplateServiceTest.java
index f3716c19..04eacd50 100644
--- a/main/src/test/java/org/onap/policy/pap/main/service/ToscaServiceTemplateServiceTest.java
+++ b/main/src/test/java/org/onap/policy/pap/main/service/ToscaServiceTemplateServiceTest.java
@@ -40,6 +40,7 @@ import org.onap.policy.common.utils.coder.StandardCoder;
import org.onap.policy.common.utils.coder.StandardYamlCoder;
import org.onap.policy.common.utils.resources.ResourceUtils;
import org.onap.policy.models.base.PfConceptKey;
+import org.onap.policy.models.base.PfKey;
import org.onap.policy.models.base.PfModelException;
import org.onap.policy.models.base.PfModelRuntimeException;
import org.onap.policy.models.tosca.authorative.concepts.ToscaNodeTemplate;
@@ -52,12 +53,14 @@ class ToscaServiceTemplateServiceTest {
private static final String VERSION_1 = "1.0.0";
+ private static final String VERSION_2 = "1.0.0+456";
+ private static final String VERSION_3 = "1.0.0-46";
private static final String VERSION = "version";
private static final String NAME = "name";
private static final String INVALID_VERSION_ERR_MSG =
- "parameter \"version\": value \"version\", does not match regular expression \"^(\\d+.){2}\\d+$\"";
+ "parameter \"version\": value \"version\", does not match regular expression \"" + PfKey.VERSION_REGEXP + "\"";
private static final String NODE_TEMPLATE_NAME = "tca_metadata";
private static final String NODE_TEMPLATE_VERSION = "1.0.0";
@@ -123,6 +126,10 @@ class ToscaServiceTemplateServiceTest {
assertThat(toscaService.getPolicyList(NAME, VERSION_1)).isEmpty();
+ assertThat(toscaService.getPolicyList(NAME, VERSION_2)).isEmpty();
+
+ assertThat(toscaService.getPolicyList(NAME, VERSION_3)).isEmpty();
+
assertThat(toscaService.getPolicyList("onap.restart.tca", VERSION_1)).hasSize(1);
}