diff options
author | Brinda Santh <brindasanth@in.ibm.com> | 2018-08-26 22:10:50 -0400 |
---|---|---|
committer | Brinda Santh <brindasanth@in.ibm.com> | 2018-08-26 22:10:50 -0400 |
commit | ee9f2dd72054056547ce7e9e96e8e9fb0eef4902 (patch) | |
tree | 365b219f4c56106e7c9fc4d476668b01f478ecbe /ms/controllerblueprints/modules/resource-dict/src/test/java | |
parent | 48c15ed0d02d98acac81773d84e928d0bd5ff07d (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/java')
-rw-r--r-- | ms/controllerblueprints/modules/resource-dict/src/test/java/org/onap/ccsdk/apps/controllerblueprints/resource/dict/service/ResourceDictionaryValidationServiceTest.java | 42 |
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 000000000..6eebdb2f0 --- /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); + + } +} |