aboutsummaryrefslogtreecommitdiffstats
path: root/ms/controllerblueprints/modules/resource-dict/src/test
diff options
context:
space:
mode:
authorMuthuramalingam, Brinda Santh <brindasanth@in.ibm.com>2019-02-27 20:16:47 -0500
committerMuthuramalingam, Brinda Santh <brindasanth@in.ibm.com>2019-03-11 09:13:22 -0400
commita5130dcf4e70f394c1432baefffc198882f04dc1 (patch)
treed0eaa477c7795db5066726def23aa6bc2cd4e363 /ms/controllerblueprints/modules/resource-dict/src/test
parentfc3e34836f7be8eda28a8f996d733e8dfca01450 (diff)
Add blueprint runtime validator
Change-Id: I9e2aa1aec392fc4191d547115fa90e8811f0f9e9 Issue-ID: CCSDK-1110 Signed-off-by: Muthuramalingam, 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/ResourceDefinitionValidationServiceTest.java56
1 files changed, 0 insertions, 56 deletions
diff --git a/ms/controllerblueprints/modules/resource-dict/src/test/java/org/onap/ccsdk/apps/controllerblueprints/resource/dict/service/ResourceDefinitionValidationServiceTest.java b/ms/controllerblueprints/modules/resource-dict/src/test/java/org/onap/ccsdk/apps/controllerblueprints/resource/dict/service/ResourceDefinitionValidationServiceTest.java
deleted file mode 100644
index 7f040b2e2..000000000
--- a/ms/controllerblueprints/modules/resource-dict/src/test/java/org/onap/ccsdk/apps/controllerblueprints/resource/dict/service/ResourceDefinitionValidationServiceTest.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * 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 ResourceDefinitionValidationServiceTest {
- private String basePath = "load/model_type";
- private String dictionaryPath = "load/resource_dictionary";
- private BluePrintRepoFileService bluePrintRepoFileService = new BluePrintRepoFileService(basePath);
-
- @Test
- public void testValidateSource() throws Exception {
-
- String inputFileName = dictionaryPath + "/input-source.json";
- testValidate(inputFileName);
-
- String dbFileName = dictionaryPath + "/primary-db-source.json";
- testValidate(dbFileName);
-
- String defaultFileName = dictionaryPath + "/default-source.json";
- testValidate(defaultFileName);
-
- String restFileName = dictionaryPath + "/mdsal-source.json";
- testValidate(restFileName);
- }
-
- private void testValidate(String fileName) throws Exception {
-
- ResourceDefinition resourceDefinition = JacksonUtils.Companion.readValueFromFile(fileName, ResourceDefinition.class);
- Assert.assertNotNull("Failed to populate dictionaryDefinition for type", resourceDefinition);
-
- ResourceDefinitionValidationService resourceDictionaryValidationService =
- new ResourceDefinitionValidationServiceImpl(bluePrintRepoFileService);
- resourceDictionaryValidationService.validate(resourceDefinition);
- Assert.assertNotNull(String.format("Failed to populate dictionaryDefinition for : %s", fileName), resourceDefinition);
- }
-}