diff options
Diffstat (limited to 'ms/controllerblueprints/modules/service/src/test')
3 files changed, 19 insertions, 7 deletions
diff --git a/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/validator/ServiceTemplateValidationTest.java b/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/validator/ServiceTemplateValidationTest.java index 0ef54452..e41e90a2 100644 --- a/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/validator/ServiceTemplateValidationTest.java +++ b/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/validator/ServiceTemplateValidationTest.java @@ -20,6 +20,8 @@ package org.onap.ccsdk.apps.controllerblueprints.service.validator; import org.apache.commons.io.FileUtils;
import org.junit.Assert;
import org.junit.Test;
+import org.onap.ccsdk.apps.controllerblueprints.core.data.ServiceTemplate;
+import org.onap.ccsdk.apps.controllerblueprints.core.utils.JacksonUtils;
import org.onap.ccsdk.apps.controllerblueprints.service.utils.ConfigModelUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -40,9 +42,22 @@ public class ServiceTemplateValidationTest { @Test
public void validateServiceTemplate() throws Exception {
- String file = "load/blueprints/baseconfiguration/Definitions/activation-blueprint.json";
+ validateServiceTemplate("load/blueprints/baseconfiguration/Definitions/activation-blueprint.json");
+ validateServiceTemplate("load/blueprints/vrr-test/Definitions/vrr-test.json");
+ }
+
+ //@Test
+ public void validateEnhancedServiceTemplate() throws Exception {
+ ServiceTemplate serviceTemplate = JacksonUtils
+ .readValueFromClassPathFile("enhance/enhanced-template.json", ServiceTemplate.class);
+ ServiceTemplateValidator serviceTemplateValidator = new ServiceTemplateValidator();
+ Boolean valid = serviceTemplateValidator.validateServiceTemplate(serviceTemplate);
+ Assert.assertTrue("Failed to validate blueprints", valid);
+ }
+
+ private void validateServiceTemplate(String fileName) throws Exception {
String serviceTemplateContent =
- FileUtils.readFileToString(new File(file), Charset.defaultCharset());
+ FileUtils.readFileToString(new File(fileName), Charset.defaultCharset());
ServiceTemplateValidator serviceTemplateValidator = new ServiceTemplateValidator();
serviceTemplateValidator.validateServiceTemplate(serviceTemplateContent);
Assert.assertNotNull("Failed to validate blueprints", serviceTemplateValidator);
diff --git a/ms/controllerblueprints/modules/service/src/test/resources/enhance/enhance-template.json b/ms/controllerblueprints/modules/service/src/test/resources/enhance/enhance-template.json index a4ba930e..fedf1da2 100644 --- a/ms/controllerblueprints/modules/service/src/test/resources/enhance/enhance-template.json +++ b/ms/controllerblueprints/modules/service/src/test/resources/enhance/enhance-template.json @@ -232,10 +232,7 @@ "dictionary-name": "wan-aggregate-ipv4-addresses",
"dictionary-source": "mdsal",
"dependencies": [
- "service-instance-id",
- "oam-network-role",
- "oam-v4-ip-type ",
- "oam-vm-type"
+ "service-instance-id"
],
"version": 0
},
diff --git a/ms/controllerblueprints/modules/service/src/test/resources/enhance/enhanced-template.json b/ms/controllerblueprints/modules/service/src/test/resources/enhance/enhanced-template.json index e0033096..0633c64d 100644 --- a/ms/controllerblueprints/modules/service/src/test/resources/enhance/enhanced-template.json +++ b/ms/controllerblueprints/modules/service/src/test/resources/enhance/enhanced-template.json @@ -738,7 +738,7 @@ "input-param" : false,
"dictionary-name" : "wan-aggregate-ipv4-addresses",
"dictionary-source" : "mdsal",
- "dependencies" : [ "service-instance-id", "oam-network-role", "oam-v4-ip-type ", "oam-vm-type" ],
+ "dependencies" : [ "service-instance-id" ],
"version" : 0
}, {
"name" : "hostname",
|