summaryrefslogtreecommitdiffstats
path: root/ms/controllerblueprints/modules/resource-dict/src/test
diff options
context:
space:
mode:
authorBrinda Santh <brindasanth@in.ibm.com>2018-08-26 22:10:50 -0400
committerBrinda Santh <brindasanth@in.ibm.com>2018-08-26 22:10:50 -0400
commit380790370ba573e0b0e0829b4fa1b38a79581a0e (patch)
tree451873185f9d51b8770342d5c55a120235787d51 /ms/controllerblueprints/modules/resource-dict/src/test
parentca395c635569bc70c16397a25dc46d7a9f0629a4 (diff)
Controller Blueprints Microservice
Add resource dictionary validation implementation services, validation repository services and Junit Test cases. Change-Id: Ia746b86b7d9098eabe5e643dcba558ef9aa7160f Issue-ID: CCSDK-487 Signed-off-by: Brinda Santh <brindasanth@in.ibm.com>
Diffstat (limited to 'ms/controllerblueprints/modules/resource-dict/src/test')
-rw-r--r--ms/controllerblueprints/modules/resource-dict/src/test/java/org/onap/ccsdk/apps/controllerblueprints/resource/dict/service/ResourceDictionaryValidationServiceTest.java42
1 files changed, 42 insertions, 0 deletions
diff --git a/ms/controllerblueprints/modules/resource-dict/src/test/java/org/onap/ccsdk/apps/controllerblueprints/resource/dict/service/ResourceDictionaryValidationServiceTest.java b/ms/controllerblueprints/modules/resource-dict/src/test/java/org/onap/ccsdk/apps/controllerblueprints/resource/dict/service/ResourceDictionaryValidationServiceTest.java
new file mode 100644
index 00000000..6eebdb2f
--- /dev/null
+++ b/ms/controllerblueprints/modules/resource-dict/src/test/java/org/onap/ccsdk/apps/controllerblueprints/resource/dict/service/ResourceDictionaryValidationServiceTest.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright © 2018 IBM.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onap.ccsdk.apps.controllerblueprints.resource.dict.service;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.onap.ccsdk.apps.controllerblueprints.core.service.BluePrintRepoFileService;
+import org.onap.ccsdk.apps.controllerblueprints.core.utils.JacksonUtils;
+import org.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceDefinition;
+
+public class ResourceDictionaryValidationServiceTest {
+ private String basePath = "load/model_type";
+ String dictionaryPath = "load/resource_dictionary";
+
+ @Test
+ public void testValidate() throws Exception {
+ BluePrintRepoFileService bluePrintRepoFileService = new BluePrintRepoFileService(basePath);
+
+ String fileName = dictionaryPath + "/db-source.json";
+ ResourceDefinition resourceDefinition = JacksonUtils.readValueFromFile(fileName, ResourceDefinition.class);
+ Assert.assertNotNull("Failed to populate dictionaryDefinition for db type", resourceDefinition);
+
+ ResourceDictionaryValidationService resourceDictionaryValidationService =
+ new ResourceDictionaryDefaultValidationService(bluePrintRepoFileService);
+ resourceDictionaryValidationService.validate(resourceDefinition);
+
+ }
+}