summaryrefslogtreecommitdiffstats
path: root/plugins/reception-plugins/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/reception-plugins/src/test')
-rw-r--r--plugins/reception-plugins/src/test/java/org/onap/policy/distribution/reception/decoding/policy/file/PolicyDecoderFileInCsarToPolicyTest.java14
-rw-r--r--plugins/reception-plugins/src/test/resources/service-Sampleservice-yaml.csarbin0 -> 78444 bytes
2 files changed, 14 insertions, 0 deletions
diff --git a/plugins/reception-plugins/src/test/java/org/onap/policy/distribution/reception/decoding/policy/file/PolicyDecoderFileInCsarToPolicyTest.java b/plugins/reception-plugins/src/test/java/org/onap/policy/distribution/reception/decoding/policy/file/PolicyDecoderFileInCsarToPolicyTest.java
index 812ef6d6..e76e9f38 100644
--- a/plugins/reception-plugins/src/test/java/org/onap/policy/distribution/reception/decoding/policy/file/PolicyDecoderFileInCsarToPolicyTest.java
+++ b/plugins/reception-plugins/src/test/java/org/onap/policy/distribution/reception/decoding/policy/file/PolicyDecoderFileInCsarToPolicyTest.java
@@ -81,6 +81,20 @@ public class PolicyDecoderFileInCsarToPolicyTest {
}
@Test
+ public void testDecodeYamlPolicy() throws PolicyDecodingException {
+
+ final PolicyDecoderFileInCsarToPolicy decoder = new PolicyDecoderFileInCsarToPolicy();
+ decoder.configure(PolicyDecoderFileInCsarToPolicyParameterGroup.class.getSimpleName());
+
+ final File file = new File("src/test/resources/service-Sampleservice-yaml.csar");
+ final Csar csar = new Csar(file.getAbsolutePath());
+
+ assertTrue(decoder.canHandle(csar));
+ final Collection<ToscaEntity> policyHolders = decoder.decode(csar);
+ assertEquals(2, policyHolders.size());
+ }
+
+ @Test
public void testDecodePolicyZipError() {
final PolicyDecoderFileInCsarToPolicy decoder = new PolicyDecoderFileInCsarToPolicy();
diff --git a/plugins/reception-plugins/src/test/resources/service-Sampleservice-yaml.csar b/plugins/reception-plugins/src/test/resources/service-Sampleservice-yaml.csar
new file mode 100644
index 00000000..386dbeeb
--- /dev/null
+++ b/plugins/reception-plugins/src/test/resources/service-Sampleservice-yaml.csar
Binary files differ