Test case improvements for APPC-1262
[appc.git] / appc-config / appc-config-params / provider / src / test / java / org / onap / sdnc / config / params / transformer / tosca / TestArtifactProcessor.java
index a321c68..d9b31e4 100644 (file)
@@ -36,6 +36,8 @@ import org.junit.Assert;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.TemporaryFolder;
+import org.onap.sdnc.config.params.data.PropertyDefinition;
+import org.onap.sdnc.config.params.transformer.ArtificatTransformer;
 import org.onap.sdnc.config.params.transformer.tosca.exceptions.ArtifactProcessorException;
 
 public class TestArtifactProcessor {
@@ -79,6 +81,14 @@ public class TestArtifactProcessor {
         String toscaString = outstream.toString();
     }
 
+    @Test
+    public void testReadArtifact() throws IOException, ArtifactProcessorException {
+        ArtifactProcessor arp = ArtifactProcessorFactory.getArtifactProcessor();
+        String pdString = getFileContent("tosca/ExpectedTosca.yml");
+        PropertyDefinition propertyDefinitionObj = arp.readArtifact(pdString);
+        Assert.assertEquals(7, propertyDefinitionObj.getParameters().size());
+    }
+
     private String getFileContent(String fileName) throws IOException {
         ClassLoader classLoader = new TestArtifactProcessor().getClass().getClassLoader();
         InputStream is = new FileInputStream(classLoader.getResource(fileName).getFile());