summaryrefslogtreecommitdiffstats
path: root/appc-sequence-generator/appc-sequence-generator-bundle/src/test/java
diff options
context:
space:
mode:
authormojahidi <mojahidul.islam@amdocs.com>2017-09-12 18:53:34 +0530
committerPatrick Brady <pb071s@att.com>2017-09-13 07:17:03 +0000
commit17a1e0e30e3a35ed4ad2ef91960bb58799b208b3 (patch)
tree3bcdc2a640c4668fc0d3a2a744ae1be9f3db5a65 /appc-sequence-generator/appc-sequence-generator-bundle/src/test/java
parentf0852a8174e38cc0c203a21a59af98e6c3889d5f (diff)
validate mandatry vnfc vm info is absent in invent
when the vnfc SMP is mandatory in the dependency-info block but its corresponding vm details/info is not present in the inventory info validation error should be thrown Issue-ID:APPC-204 Change-Id: I606da8ce086423cf3f23c87ab0166bfb9935875b Signed-off-by: mojahidi <mojahidul.islam@amdocs.com>
Diffstat (limited to 'appc-sequence-generator/appc-sequence-generator-bundle/src/test/java')
-rw-r--r--appc-sequence-generator/appc-sequence-generator-bundle/src/test/java/org/openecomp/appc/seqgen/TestSequenceGeneratorPlugin.java18
1 files changed, 17 insertions, 1 deletions
diff --git a/appc-sequence-generator/appc-sequence-generator-bundle/src/test/java/org/openecomp/appc/seqgen/TestSequenceGeneratorPlugin.java b/appc-sequence-generator/appc-sequence-generator-bundle/src/test/java/org/openecomp/appc/seqgen/TestSequenceGeneratorPlugin.java
index e36b9f09d..5ab75b634 100644
--- a/appc-sequence-generator/appc-sequence-generator-bundle/src/test/java/org/openecomp/appc/seqgen/TestSequenceGeneratorPlugin.java
+++ b/appc-sequence-generator/appc-sequence-generator-bundle/src/test/java/org/openecomp/appc/seqgen/TestSequenceGeneratorPlugin.java
@@ -230,6 +230,22 @@ public class TestSequenceGeneratorPlugin {
Assert.assertEquals(outputJSON.trim(),actualOutput.trim());
}
+ @Test
+ public void testGenerateSequenceVnfcNotPresentInInventory() throws URISyntaxException, IOException {
+ String inputJSON = readInput("/input/CheckVNfcInInventory.json");
+
+ Map<String,String> params = new HashMap<>();
+ SvcLogicContext context = new SvcLogicContext();
+ context.setAttribute("inputJSON",inputJSON);
+ SequenceGeneratorPlugin plugin = new SequenceGeneratorPluginImpl();
+ plugin.generateSequence(params,context);
+
+ String outputJSON = context.getAttribute("output");
+ String actualOutput = readOutput("/output/CheckVnfcInInventory.json");
+
+ Assert.assertEquals(outputJSON.trim(),actualOutput.trim());
+ }
+
private String readInput(String inputFile) throws URISyntaxException, IOException {
File file = new File(this.getClass().getResource(inputFile).toURI());
@@ -249,7 +265,7 @@ public class TestSequenceGeneratorPlugin {
String output=new String(bFile);
int start=output.indexOf("[");
- int last=output.length()-1;
+ int last=output.length();
return output.substring(start,last);
}