aboutsummaryrefslogtreecommitdiffstats
path: root/ms/controllerblueprints/modules/service/src/test/java
diff options
context:
space:
mode:
authorMuthuramalingam, Brinda Santh(bs2796) <bs2796@att.com>2018-08-30 14:17:06 +0000
committerMuthuramalingam, Brinda Santh(bs2796) <bs2796@att.com>2018-08-30 14:17:06 +0000
commite0bf80ea0f864a4da8bc2d9bf6e5b19bde75af41 (patch)
treef737c89033488ace40d95d1552ba266eb4d3a9c2 /ms/controllerblueprints/modules/service/src/test/java
parent2a7cd18ca4aaf6d050fe8740bcde53e9a214d224 (diff)
Controller Blueprints Microservice
Add Resource Seuencing validation and Optimise resource assignment validation logics Change-Id: I6f31ca5dbeb6f6aa89959b7d96fbfad25468b3a4 Issue-ID: CCSDK-416 Signed-off-by: Muthuramalingam, Brinda Santh(bs2796) <bs2796@att.com>
Diffstat (limited to 'ms/controllerblueprints/modules/service/src/test/java')
-rw-r--r--ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/validator/ServiceTemplateValidationTest.java19
1 files changed, 17 insertions, 2 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);