From e794b73443f37d92ea122336324e17709824df9d Mon Sep 17 00:00:00 2001 From: "Tufman, Shay" Date: Tue, 20 Nov 2018 14:48:55 +0200 Subject: fix null pointer Change-Id: If530734b96c32b25b2ed5df847c83dca2c633184 Issue-ID: SDC-1926 Signed-off-by: Tufman, Shay --- .../java/org/onap/sdc/toscaparser/api/JToscaImportTest.java | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/test/java/org') diff --git a/src/test/java/org/onap/sdc/toscaparser/api/JToscaImportTest.java b/src/test/java/org/onap/sdc/toscaparser/api/JToscaImportTest.java index 6fc8771..8e587a9 100644 --- a/src/test/java/org/onap/sdc/toscaparser/api/JToscaImportTest.java +++ b/src/test/java/org/onap/sdc/toscaparser/api/JToscaImportTest.java @@ -111,6 +111,16 @@ public class JToscaImportTest { assertNull(nodeTemplate.getPropertyValueFromTemplatesByName("test")); } + @Test + public void testNullValueHasNoNullPointerException() throws JToscaException { + + String fileStr = JToscaImportTest.class.getClassLoader().getResource("csars/service-JennyVtsbcKarunaSvc-csar.csar").getFile(); + File file = new File(fileStr); + ToscaTemplate toscaTemplate = new ToscaTemplate(file.getAbsolutePath(), null, true, null); + List inputs = toscaTemplate.getInputs(); + assertNotNull(inputs); + } + private void validateInputsAnnotations(List inputs) { List inputsWithAnnotations = inputs.stream().filter(i -> i.getAnnotations() != null) .collect(Collectors.toList()); -- cgit 1.2.3-korg