X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=src%2Ftest%2Fjava%2Forg%2Fonap%2Fclamp%2Fclds%2Ftosca%2Fupdate%2FToscaConverterWithDictionarySupportItCase.java;h=1d4ee431174ea85d6d24b8f5526207626df675b3;hb=88fd35f7b46041f723cff0eaaf4ea4ed46e9530f;hp=3ff6ffb339ae52d1ef76ff9c486763c86dcfe876;hpb=98bade58e0ab9b74378e4e3214700e7b00e10d7d;p=clamp.git diff --git a/src/test/java/org/onap/clamp/clds/tosca/update/ToscaConverterWithDictionarySupportItCase.java b/src/test/java/org/onap/clamp/clds/tosca/update/ToscaConverterWithDictionarySupportItCase.java index 3ff6ffb3..1d4ee431 100644 --- a/src/test/java/org/onap/clamp/clds/tosca/update/ToscaConverterWithDictionarySupportItCase.java +++ b/src/test/java/org/onap/clamp/clds/tosca/update/ToscaConverterWithDictionarySupportItCase.java @@ -33,7 +33,7 @@ import org.onap.clamp.clds.tosca.update.execution.ToscaMetadataExecutor; import org.onap.clamp.clds.tosca.update.parser.metadata.ToscaMetadataParserWithDictionarySupport; import org.onap.clamp.clds.tosca.update.templates.JsonTemplateManager; import org.onap.clamp.clds.util.JsonUtils; -import org.onap.clamp.clds.util.ResourceFileUtil; +import org.onap.clamp.clds.util.ResourceFileUtils; import org.onap.clamp.loop.service.Service; import org.onap.clamp.tosca.Dictionary; import org.onap.clamp.tosca.DictionaryElement; @@ -41,10 +41,12 @@ import org.onap.clamp.tosca.DictionaryService; import org.skyscreamer.jsonassert.JSONAssert; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; @RunWith(SpringJUnit4ClassRunner.class) @SpringBootTest(classes = Application.class) +@ActiveProfiles({"clamp-default","clamp-default-user","default-dictionary-elements"}) public class ToscaConverterWithDictionarySupportItCase { @Autowired @@ -108,15 +110,16 @@ public class ToscaConverterWithDictionarySupportItCase { JsonTemplateManager jsonTemplateManager = new JsonTemplateManager( - ResourceFileUtil.getResourceAsString("tosca/new-converter/tosca_metadata_clamp_possible_values.yaml"), - ResourceFileUtil.getResourceAsString("clds/tosca-converter/default-tosca-types.yaml"), - ResourceFileUtil.getResourceAsString("clds/tosca-converter/templates.json")); + ResourceFileUtils + .getResourceAsString("tosca/new-converter/tosca_metadata_clamp_possible_values.yaml"), + ResourceFileUtils.getResourceAsString("clds/tosca-converter/default-tosca-types.yaml"), + ResourceFileUtils.getResourceAsString("clds/tosca-converter/templates.json")); JsonObject jsonSchema = jsonTemplateManager.getJsonSchemaForPolicyType( "onap.policies.monitoring.cdap.tca.hi.lo.app", toscaMetadataParserWithDictionarySupport, null); JSONAssert.assertEquals( - ResourceFileUtil + ResourceFileUtils .getResourceAsString("tosca/new-converter/tca-with-metadata.json"), JsonUtils.GSON.toJson(jsonSchema), true); } @@ -124,21 +127,20 @@ public class ToscaConverterWithDictionarySupportItCase { @Test @Transactional public final void testMetadataClampPossibleValueWithExecutor() throws IOException, UnknownComponentException { - Service service = new Service(ResourceFileUtil.getResourceAsString("tosca/service-details.json"), - ResourceFileUtil.getResourceAsString("tosca/resource-details.json")); + Service service = new Service(ResourceFileUtils.getResourceAsString("tosca/service-details.json"), + ResourceFileUtils.getResourceAsString("tosca/resource-details-cds.json")); JsonTemplateManager jsonTemplateManager = new JsonTemplateManager( - ResourceFileUtil.getResourceAsString("http-cache/example/policy/api/v1/policytypes/onap" - + ".policies.controlloop.operational.common.Apex/versions/1.0" - + ".0?connectionTimeToLive=5000/.file"), - ResourceFileUtil.getResourceAsString("clds/tosca-converter/default-tosca-types.yaml"), - ResourceFileUtil.getResourceAsString("clds/tosca-converter/templates.json")); + ResourceFileUtils.getResourceAsString("http-cache/example/policy/api/v1/policytypes/onap" + + ".policies.controlloop.operational.common.Apex/versions/1.0.0/.file"), + ResourceFileUtils.getResourceAsString("clds/tosca-converter/default-tosca-types.yaml"), + ResourceFileUtils.getResourceAsString("clds/tosca-converter/templates.json")); JsonObject jsonSchema = jsonTemplateManager.getJsonSchemaForPolicyType( "onap.policies.controlloop.operational.common.Apex", toscaMetadataParserWithDictionarySupport, service); JSONAssert.assertEquals( - ResourceFileUtil + ResourceFileUtils .getResourceAsString("tosca/new-converter/tosca_apex_with_metadata.json"), JsonUtils.GSON.toJson(jsonSchema), true); }