aboutsummaryrefslogtreecommitdiffstats
path: root/asdctool/src/test/java/org
diff options
context:
space:
mode:
authork.kazak <k.kazak@samsung.com>2019-05-29 14:50:05 +0200
committerOren Kleks <orenkle@amdocs.com>2019-06-03 05:56:58 +0000
commit8d52607c8fa8fd4dde5f9c3fec0a8c6ee7a4960d (patch)
tree307b6ea5910bf02a27205a7bea73b14318c79e7f /asdctool/src/test/java/org
parentf4f6b1407a836266ce7d98f33ee899d8a2377d83 (diff)
fix sonar: close resources
Use try-with-resources to close file data stream Fix tests for GraphJsonValidator Change-Id: I20931b4ef815abfb8da8ebd6242b765d0b02ef23 Issue-ID: SDC-2340 Signed-off-by: k.kazak@samsung.com
Diffstat (limited to 'asdctool/src/test/java/org')
-rw-r--r--asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/GraphJsonValidatorTest.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/GraphJsonValidatorTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/GraphJsonValidatorTest.java
index ab6c49cdc9..06beb8d409 100644
--- a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/GraphJsonValidatorTest.java
+++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/GraphJsonValidatorTest.java
@@ -1,5 +1,8 @@
package org.openecomp.sdc.asdctool.impl;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
import org.junit.Test;
import java.nio.file.NoSuchFileException;
@@ -18,6 +21,7 @@ public class GraphJsonValidatorTest {
// default test
testSubject = createTestSubject();
result = testSubject.verifyTitanJson("src/test/resources/graph.json");
+ assertTrue(result);
}
@Test
@@ -28,15 +32,15 @@ public class GraphJsonValidatorTest {
// default test
testSubject = createTestSubject();
result = testSubject.verifyTitanJson("src/test/resources/graphError.json");
+ assertFalse(result);
}
@Test(expected=NoSuchFileException.class)
public void testVerifyTitanJsonNoFile() throws Exception {
GraphJsonValidator testSubject;
- boolean result;
// default test
testSubject = createTestSubject();
- result = testSubject.verifyTitanJson("stam");
+ testSubject.verifyTitanJson("stam");
}
-} \ No newline at end of file
+}