diff options
Diffstat (limited to 'csarvalidation/src/test/java/org/onap')
3 files changed, 9 insertions, 19 deletions
diff --git a/csarvalidation/src/test/java/org/onap/cvc/csar/PnfManifestParserTest.java b/csarvalidation/src/test/java/org/onap/cvc/csar/PnfManifestParserTest.java index 2f3a050..09a2706 100644 --- a/csarvalidation/src/test/java/org/onap/cvc/csar/PnfManifestParserTest.java +++ b/csarvalidation/src/test/java/org/onap/cvc/csar/PnfManifestParserTest.java @@ -67,7 +67,7 @@ public class PnfManifestParserTest { @Test public void shouldFetchNonManoArtifactsFromFile() { - Pair<Map<String, Map<String, List<String>>>, List<CSARArchive.CSARError>> mapListPair = pnfManifestParser.fetchNonManoArtifacts(); + Pair<Map<String, Map<String, List<String>>>, List<CSARArchive.CSARError>> mapListPair = pnfManifestParser.fetchNonManoArtifacts().get(); Map<String, Map<String, List<String>>> nonManoArtifacts = mapListPair.getKey(); List<CSARArchive.CSARError> errors= mapListPair.getValue(); diff --git a/csarvalidation/src/test/java/org/onap/cvc/csar/PnfNonManoArtifactsParserTest.java b/csarvalidation/src/test/java/org/onap/cvc/csar/PnfNonManoArtifactsParserTest.java index 91d2648..92733bb 100644 --- a/csarvalidation/src/test/java/org/onap/cvc/csar/PnfNonManoArtifactsParserTest.java +++ b/csarvalidation/src/test/java/org/onap/cvc/csar/PnfNonManoArtifactsParserTest.java @@ -21,14 +21,14 @@ import org.junit.Test; import java.util.List; import java.util.Map; -import java.util.stream.Collectors; +import java.util.Optional; import static org.assertj.core.api.Assertions.assertThat; public class PnfNonManoArtifactsParserTest { @Test - public void shouldReportAnErrorWhenNonManoArtifactSectionIsNotAvailable() { + public void shouldDoNotReportAnErrorWhenNonManoArtifactSectionIsNotAvailable() { // given List<String> lines = Lists.newArrayList( "someSection:", @@ -40,14 +40,11 @@ public class PnfNonManoArtifactsParserTest { // when PnfManifestParser pnfManifestParser = new PnfManifestParser(lines, "fileName"); - Pair<Map<String, Map<String, List<String>>>, List<CSARArchive.CSARError>> data = pnfManifestParser.fetchNonManoArtifacts(); + Optional<Pair<Map<String, Map<String, List<String>>>, List<CSARArchive.CSARError>>> nonManoArtifacts = + pnfManifestParser.fetchNonManoArtifacts(); //then - List<CSARArchive.CSARError> errors = data.getRight(); - assertThat(errors.size()).isEqualTo(1); - assertThat(errors.stream().map(CSARArchive.CSARError::getMessage).collect(Collectors.toList())).contains( - "Missing. Entry [non_mano_artifact_sets]" - ); + assertThat(nonManoArtifacts.isPresent()).isFalse(); } @Test @@ -69,7 +66,7 @@ public class PnfNonManoArtifactsParserTest { // when PnfManifestParser pnfManifestParser = new PnfManifestParser(lines, "fileName"); - Pair<Map<String, Map<String, List<String>>>, List<CSARArchive.CSARError>> data = pnfManifestParser.fetchNonManoArtifacts(); + Pair<Map<String, Map<String, List<String>>>, List<CSARArchive.CSARError>> data = pnfManifestParser.fetchNonManoArtifacts().get(); //then List<CSARArchive.CSARError> errors = data.getRight(); diff --git a/csarvalidation/src/test/java/org/onap/cvc/csar/cc/sol004/VTPValidateCSARR146092IntegrationTest.java b/csarvalidation/src/test/java/org/onap/cvc/csar/cc/sol004/VTPValidateCSARR146092IntegrationTest.java index a59282c..ba51882 100644 --- a/csarvalidation/src/test/java/org/onap/cvc/csar/cc/sol004/VTPValidateCSARR146092IntegrationTest.java +++ b/csarvalidation/src/test/java/org/onap/cvc/csar/cc/sol004/VTPValidateCSARR146092IntegrationTest.java @@ -43,7 +43,7 @@ public class VTPValidateCSARR146092IntegrationTest { } @Test - public void shouldReportThatMandatoryNonManoArtifactsAreNotAvailable() throws Exception { + public void shouldDoNotReportErrorWhenNonManoArtifactIsNotAvailable() throws Exception { // given configureTestCase(testCase, "pnf/r146092/missingNonManoArtifactInManifest.csar"); @@ -52,14 +52,7 @@ public class VTPValidateCSARR146092IntegrationTest { // then List<CSARArchive.CSARError> errors = testCase.getErrors(); - assertThat(errors.size()).isEqualTo(5); - assertThat(convertToMessagesList(errors)).contains( - "Missing. Entry [non_mano_artifact_sets]", - "Missing. Entry [onap_ves_events]", - "Missing. Entry [onap_pm_dictionary]", - "Missing. Entry [onap_yang_module]", - "Missing. Entry [onap_others]" - ); + assertThat(errors.size()).isEqualTo(0); } @Test |