diff options
author | andre.schmid <andre.schmid@est.tech> | 2019-09-30 17:47:27 +0100 |
---|---|---|
committer | Ofir Sonsino <ofir.sonsino@intl.att.com> | 2019-11-03 16:44:13 +0000 |
commit | f34e28d521b71be501dc85e75c5efa411c3194f1 (patch) | |
tree | 461dba7844dda13f0aad36c660c64cade0833cdf /openecomp-be/lib/openecomp-tosca-lib/src/test/java/org | |
parent | 608be265c8491686f269ed12d5d48654ddb090b5 (diff) |
Validate artifacts signature in SOL004 package
Change-Id: Ib048f4501fd8a81cdf11fab19f149350011f772e
Issue-ID: SDC-2632
Signed-off-by: andre.schmid <andre.schmid@est.tech>
Diffstat (limited to 'openecomp-be/lib/openecomp-tosca-lib/src/test/java/org')
-rw-r--r-- | openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/csar/MetadataParsingTest.java | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/csar/MetadataParsingTest.java b/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/csar/MetadataParsingTest.java index 936371990a..51cdfa990d 100644 --- a/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/csar/MetadataParsingTest.java +++ b/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/csar/MetadataParsingTest.java @@ -24,9 +24,9 @@ package org.openecomp.sdc.tosca.csar; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNull; -import static org.openecomp.sdc.tosca.csar.CSARConstants.TOSCA_META_ETSI_ENTRY_CHANGE_LOG; -import static org.openecomp.sdc.tosca.csar.CSARConstants.TOSCA_META_ENTRY_DEFINITIONS; -import static org.openecomp.sdc.tosca.csar.CSARConstants.TOSCA_META_ETSI_ENTRY_MANIFEST; +import static org.openecomp.sdc.tosca.csar.ToscaMetaEntry.ENTRY_DEFINITIONS; +import static org.openecomp.sdc.tosca.csar.ToscaMetaEntry.ETSI_ENTRY_CHANGE_LOG; +import static org.openecomp.sdc.tosca.csar.ToscaMetaEntry.ETSI_ENTRY_MANIFEST; import java.io.IOException; import java.io.InputStream; @@ -43,7 +43,7 @@ public class MetadataParsingTest { .getResourceAsStream("/vspmanager.csar/metadata/Invalidtosca.meta")) { ToscaMetadata onboardingToscaMetadata = OnboardingToscaMetadata.parseToscaMetadataFile(is); assertFalse(onboardingToscaMetadata.isValid()); - assertNull(onboardingToscaMetadata.getMetaEntries().get(TOSCA_META_ENTRY_DEFINITIONS)); + assertNull(onboardingToscaMetadata.getMetaEntries().get(ENTRY_DEFINITIONS.getName())); } } @@ -52,7 +52,8 @@ public class MetadataParsingTest { try (InputStream is = getClass() .getResourceAsStream("/vspmanager.csar/metadata/Validtosca.meta")) { ToscaMetadata onboardingToscaMetadata = OnboardingToscaMetadata.parseToscaMetadataFile(is); - assertEquals(onboardingToscaMetadata.getMetaEntries().get(TOSCA_META_ENTRY_DEFINITIONS), "Definitions/MainServiceTemplate.yaml"); + assertEquals("Definitions/MainServiceTemplate.yaml", onboardingToscaMetadata.getMetaEntries().get( + ENTRY_DEFINITIONS.getName())); } } @@ -80,9 +81,10 @@ public class MetadataParsingTest { try (InputStream is = getClass() .getResourceAsStream("/vspmanager.csar/metadata/ValidETSItosca.meta")) { ToscaMetadata onboardingToscaMetadata = OnboardingToscaMetadata.parseToscaMetadataFile(is); - assertEquals(onboardingToscaMetadata.getMetaEntries().get(TOSCA_META_ENTRY_DEFINITIONS), "Definitions/MainServiceTemplate.yaml"); - assertEquals(onboardingToscaMetadata.getMetaEntries().get(TOSCA_META_ETSI_ENTRY_MANIFEST), "MainServiceTemplate.mf"); - assertEquals(onboardingToscaMetadata.getMetaEntries().get(TOSCA_META_ETSI_ENTRY_CHANGE_LOG), "change.log"); + assertEquals("Definitions/MainServiceTemplate.yaml", onboardingToscaMetadata.getMetaEntries().get( + ENTRY_DEFINITIONS.getName())); + assertEquals("MainServiceTemplate.mf", onboardingToscaMetadata.getMetaEntries().get(ETSI_ENTRY_MANIFEST.getName())); + assertEquals("change.log", onboardingToscaMetadata.getMetaEntries().get(ETSI_ENTRY_CHANGE_LOG.getName())); } } |