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
commit948114a77bcf55433191e31de8f0612f55b01612 (patch)
treea6cae5c531d5eb755b73bfa3a0c089d94b8f1b74 /ms/controllerblueprints/modules/resource-dict/src/test
parenta5d9a4ddb92bad7d3334d8a6f9bc93879b8009ef (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 7f040b2e..00000000
--- 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);
- }
-}