From a5130dcf4e70f394c1432baefffc198882f04dc1 Mon Sep 17 00:00:00 2001 From: "Muthuramalingam, Brinda Santh" Date: Wed, 27 Feb 2019 20:16:47 -0500 Subject: Add blueprint runtime validator Change-Id: I9e2aa1aec392fc4191d547115fa90e8811f0f9e9 Issue-ID: CCSDK-1110 Signed-off-by: Muthuramalingam, Brinda Santh --- .../ResourceDefinitionValidationServiceTest.java | 56 ---------------------- 1 file changed, 56 deletions(-) delete mode 100644 ms/controllerblueprints/modules/resource-dict/src/test/java/org/onap/ccsdk/apps/controllerblueprints/resource/dict/service/ResourceDefinitionValidationServiceTest.java (limited to 'ms/controllerblueprints/modules/resource-dict/src/test/java') 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); - } -} -- cgit 1.2.3-korg