diff options
author | aravind.est <aravindhan.a@est.tech> | 2023-05-02 16:13:29 +0100 |
---|---|---|
committer | aravind.est <aravindhan.a@est.tech> | 2023-05-02 16:13:29 +0100 |
commit | d06f19333fda2865ed7a5beffa278daaba0f6aa3 (patch) | |
tree | d1f15203257b9b2d1183ae6e0c852df2106075d0 /so-cnfm/so-cnfm-lcm/so-cnfm-lcm-bpmn-flows/src/test/java | |
parent | 2710810d1e058b9442bbb8b3f7d468a5ab31955a (diff) |
Fixed the CSAR file processing when the contents of the CSAR file is in alphabetical order (Definitions/asd.yaml file before TOSCA-Metadata/TOSCA.meta).
Issue-ID: SO-4098
Signed-off-by: aravind.est <aravindhan.a@est.tech>
Change-Id: I0e9c0730825eca4069ac4cb0f7ae2f97ed56efaf
Diffstat (limited to 'so-cnfm/so-cnfm-lcm/so-cnfm-lcm-bpmn-flows/src/test/java')
-rw-r--r-- | so-cnfm/so-cnfm-lcm/so-cnfm-lcm-bpmn-flows/src/test/java/org/onap/so/cnfm/lcm/bpmn/flows/extclients/sdc/SdcCsarPackageParserTest.java | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/so-cnfm/so-cnfm-lcm/so-cnfm-lcm-bpmn-flows/src/test/java/org/onap/so/cnfm/lcm/bpmn/flows/extclients/sdc/SdcCsarPackageParserTest.java b/so-cnfm/so-cnfm-lcm/so-cnfm-lcm-bpmn-flows/src/test/java/org/onap/so/cnfm/lcm/bpmn/flows/extclients/sdc/SdcCsarPackageParserTest.java index 8374faa..9de5419 100644 --- a/so-cnfm/so-cnfm-lcm/so-cnfm-lcm-bpmn-flows/src/test/java/org/onap/so/cnfm/lcm/bpmn/flows/extclients/sdc/SdcCsarPackageParserTest.java +++ b/so-cnfm/so-cnfm-lcm/so-cnfm-lcm-bpmn-flows/src/test/java/org/onap/so/cnfm/lcm/bpmn/flows/extclients/sdc/SdcCsarPackageParserTest.java @@ -29,25 +29,41 @@ import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; +import java.util.Arrays; import java.util.List; import java.util.Map; import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; /** * * @author Waqas Ikram (waqas.ikram@est.tech) * */ +@RunWith(Parameterized.class) public class SdcCsarPackageParserTest { private static final String RESOURCE_ASD_PACKAGE_CSAR_PATH = "src/test/resources/resource-Generatedasdpackage-csar.csar"; + private static final String RESOURCE_ASD_ALPHABETICAL_PACKAGE_CSAR_PATH = + "src/test/resources/resource-Generatedasdpackage-csar-alphabetical.csar"; + + + @Parameterized.Parameter + public String resourceCsarPath; + + @Parameterized.Parameters + public static Iterable<String> data() { + return Arrays.asList(RESOURCE_ASD_PACKAGE_CSAR_PATH, RESOURCE_ASD_ALPHABETICAL_PACKAGE_CSAR_PATH); + } + @Test public void testResourceAsdCsar() throws IOException { final SdcCsarPackageParser objUnderTest = new SdcCsarPackageParser(); - final byte[] content = getFileContent(Paths.get(getAbsolutePath(RESOURCE_ASD_PACKAGE_CSAR_PATH))); + final byte[] content = getFileContent(Paths.get(getAbsolutePath(resourceCsarPath))); final Map<String, Object> properties = objUnderTest.getAsdProperties(content); assertEquals("123e4567-e89b-12d3-a456-426614174000", properties.get(DESCRIPTOR_ID_PARAM_NAME)); |