summaryrefslogtreecommitdiffstats
path: root/csarvalidation/src/test/java
diff options
context:
space:
mode:
authorBogumil Zebek <bogumil.zebek@nokia.com>2019-05-27 14:24:13 +0200
committerZebek Bogumil <bogumil.zebek@nokia.com>2019-05-30 11:08:38 +0200
commit84eb0c707c621e4855bf27e49be0cc69ded1f321 (patch)
tree3e4a04a9ed0754640da04f7713437d42dea43cd6 /csarvalidation/src/test/java
parent2b293e3d6c9c2ff693ccebf8ee757980cf6e2499 (diff)
Specification change
Change-Id: I7810f0310d6c2ae178c6d865494fff88c8751634 Issue-ID: VNFSDK-410 Signed-off-by: Zebek Bogumil <bogumil.zebek@nokia.com>
Diffstat (limited to 'csarvalidation/src/test/java')
-rw-r--r--csarvalidation/src/test/java/org/onap/cvc/csar/PnfManifestParserTest.java2
-rw-r--r--csarvalidation/src/test/java/org/onap/cvc/csar/PnfNonManoArtifactsParserTest.java15
-rw-r--r--csarvalidation/src/test/java/org/onap/cvc/csar/cc/sol004/VTPValidateCSARR146092IntegrationTest.java11
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