diff options
author | davsad <david.sadlier@est.tech> | 2021-02-05 13:12:57 +0000 |
---|---|---|
committer | Christophe Closset <christophe.closset@intl.att.com> | 2021-02-20 07:12:05 +0000 |
commit | b1660e1be36e1f6572253f871dd5defa4030c98a (patch) | |
tree | cc856617ca244e651b139b4d61b7e7057b52dcb8 /openecomp-be/lib/openecomp-tosca-lib/src/test/java | |
parent | 372c2470e613128f1e33cfc581ea2c5b1b732d2b (diff) |
Add new SOL004 validator
New validator for onboarding SOL 004 version 3.3.1
Issue-ID: SDC-2611
Signed-off-by: davsad <david.sadlier@est.tech>
Change-Id: I4f41d2fbd913011f42a8319a6594c973c735d2a0
Diffstat (limited to 'openecomp-be/lib/openecomp-tosca-lib/src/test/java')
-rw-r--r-- | openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/csar/SOL004ManifestOnboardingTest.java | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/csar/SOL004ManifestOnboardingTest.java b/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/csar/SOL004ManifestOnboardingTest.java index 288995dfed..beae6af0b4 100644 --- a/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/csar/SOL004ManifestOnboardingTest.java +++ b/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/csar/SOL004ManifestOnboardingTest.java @@ -489,6 +489,29 @@ class SOL004ManifestOnboardingTest { } } + @Test + public void testSuccessfulParsingWithCompatibleSpecficationVersion() throws IOException { + try (final InputStream manifestAsStream = + getClass().getResourceAsStream("/vspmanager.csar/manifest/ValidToscaVersion3.mf")) { + manifest.parse(manifestAsStream); + assertValidManifest(8, 5, Collections.emptyMap(), ResourceTypeEnum.VF, false); + } + } + + @Test + public void testFailedParsingWithCompatibleSpecficationVersion() throws IOException { + try (final InputStream manifestAsStream = + getClass().getResourceAsStream("/vspmanager.csar/manifest/InvalidToscaVersion3.mf")) { + manifest.parse(manifestAsStream); + final List<String> errorList = Collections.singletonList( + Messages.MANIFEST_ERROR_WITH_LINE.formatMessage( + Messages.MANIFEST_METADATA_INVALID_ENTRY1.formatMessage("vnf_test: 1.0"), + 4, "vnf_test: 1.0") + ); + assertInvalidManifest(errorList); + } + } + private void assertValidManifest(final int expectedMetadataSize, final int expectedSourcesSize, final Map<String, Integer> expectedNonManoKeySize, final ResourceTypeEnum resourceType, final boolean isSigned) { |