X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=src%2Ftest%2Fjava%2Forg%2Fonap%2Faai%2Fbabel%2Futil%2FArtifactTestUtils.java;h=445dd847347f2a8b016f0707e8594f1b10cf85a6;hb=4217e6f7018d08b11291490b3ad5c54064cdc031;hp=6608c0096ffa79b20eb26a5f6d33a1dfd1beb76d;hpb=1954294aed95c2db4eb2659dcef91248535de079;p=aai%2Fbabel.git diff --git a/src/test/java/org/onap/aai/babel/util/ArtifactTestUtils.java b/src/test/java/org/onap/aai/babel/util/ArtifactTestUtils.java index 6608c00..445dd84 100644 --- a/src/test/java/org/onap/aai/babel/util/ArtifactTestUtils.java +++ b/src/test/java/org/onap/aai/babel/util/ArtifactTestUtils.java @@ -56,6 +56,9 @@ public class ArtifactTestUtils { private static final String JSON_RESPONSES_FOLDER = "response/"; private static final String CSAR_INPUTS_FOLDER = "compressedArtifacts/"; + /** + * Initialise System Properties for test configuration files. + */ public void setGeneratorSystemProperties() { System.setProperty(ArtifactGeneratorToscaParser.PROPERTY_ARTIFACT_GENERATOR_CONFIG_FILE, getResourcePath(Resources.ARTIFACT_GENERATOR_CONFIG)); @@ -143,6 +146,15 @@ public class ArtifactTestUtils { return Files.lines(Paths.get(getResource(resourceFile).toURI())).collect(Collectors.joining()); } + /** + * Create Properties from the content of the named resource (e.g. a file on the classpath). + * + * @param resourceName + * the resource name + * @return Properties loaded from the named resource + * @throws IOException + * if an error occurred when reading from the named resource + */ public Properties getResourceAsProperties(String resourceName) throws IOException { final Properties properties = new Properties(); InputStream in = ArtifactTestUtils.class.getClassLoader().getResourceAsStream(resourceName);