From ff0842117fba4dfe675a8b87af3a1098cde023bd Mon Sep 17 00:00:00 2001 From: Jim Hahn Date: Mon, 29 Jun 2020 10:16:44 -0400 Subject: 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 --- .../org/onap/policy/common/gson/internal/FieldSerializerTest.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'gson') diff --git a/gson/src/test/java/org/onap/policy/common/gson/internal/FieldSerializerTest.java b/gson/src/test/java/org/onap/policy/common/gson/internal/FieldSerializerTest.java index cc5ef928..156e4ef3 100644 --- a/gson/src/test/java/org/onap/policy/common/gson/internal/FieldSerializerTest.java +++ b/gson/src/test/java/org/onap/policy/common/gson/internal/FieldSerializerTest.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * ONAP * ================================================================================ - * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -89,7 +89,9 @@ public class FieldSerializerTest { text = "world"; - assertThatThrownBy(() -> ser.addToTree(this, new JsonObject())).isInstanceOf(JsonParseException.class) + JsonObject obj = new JsonObject(); + + assertThatThrownBy(() -> ser.addToTree(this, obj)).isInstanceOf(JsonParseException.class) .hasMessage(FieldSerializer.GET_ERR + FieldSerializerTest.class.getName() + ".text"); } } -- cgit 1.2.3-korg