diff options
author | Jim Hahn <jrh3@att.com> | 2020-06-29 10:16:44 -0400 |
---|---|---|
committer | Jim Hahn <jrh3@att.com> | 2020-06-29 11:09:58 -0400 |
commit | ff0842117fba4dfe675a8b87af3a1098cde023bd (patch) | |
tree | 1dde66fc3323e9bb3edec8bf83df1456cbf6fffd /utils-test/src/test/java/org/onap/policy/common/utils/gson/GsonTestUtilsTest.java | |
parent | 4cdfdf4fa218a3b4f7e9690355db85976bc1888d (diff) |
Fix issues in common for new sonar rules
Addressed issues reported due to updates to the sonar rules:
- invoke only one method in a junit lambda
- complete the assertion
- add DOCTYPE to html
Issue-ID: POLICY-2650
Change-Id: Ib8b8a2e4736cc23849c0f7aef972ffa3365a3e00
Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'utils-test/src/test/java/org/onap/policy/common/utils/gson/GsonTestUtilsTest.java')
-rw-r--r-- | utils-test/src/test/java/org/onap/policy/common/utils/gson/GsonTestUtilsTest.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/utils-test/src/test/java/org/onap/policy/common/utils/gson/GsonTestUtilsTest.java b/utils-test/src/test/java/org/onap/policy/common/utils/gson/GsonTestUtilsTest.java index 11ee63c0..f16764c9 100644 --- a/utils-test/src/test/java/org/onap/policy/common/utils/gson/GsonTestUtilsTest.java +++ b/utils-test/src/test/java/org/onap/policy/common/utils/gson/GsonTestUtilsTest.java @@ -76,10 +76,11 @@ public class GsonTestUtilsTest { utils.compareGson(data, GsonTestUtilsTest.class); // file not found - assertThatThrownBy(() -> utils.compareGson(data, - new File(GsonTestUtilsTest.class.getSimpleName() + "-NotFound.json"))) - .isInstanceOf(JsonParseException.class) - .hasCauseInstanceOf(FileNotFoundException.class); + File file = new File(GsonTestUtilsTest.class.getSimpleName() + "-NotFound.json"); + + assertThatThrownBy(() -> utils.compareGson(data, file)) + .isInstanceOf(JsonParseException.class) + .hasCauseInstanceOf(FileNotFoundException.class); // force I/O error while reading file GsonTestUtils utils2 = new GsonTestUtils() { |