diff options
author | waynedunican <wayne.dunican@est.tech> | 2024-07-23 09:23:51 +0100 |
---|---|---|
committer | waynedunican <wayne.dunican@est.tech> | 2024-08-13 08:49:10 +0100 |
commit | b7804abcf865dc58a01bed3f2be4756e731d9288 (patch) | |
tree | 7f6fc3b50622578bb8612de9fe5e5c6adddfaf28 /models-sim | |
parent | a029ccab07f2dd71286804da620c513da9fdfc0e (diff) |
Improve code coverage and sonar fixes
Increased code coverage to 90%
SONAR - Removed TODO comments
SONAR - Added NOSONAR where appropriate
SONAR - Replaced stream.Collect() with stream.toList() where applicable
SONAR - Made variables serializable or transient to comply with sonar rules
Issue-ID: POLICY-5069
Change-Id: Ife256eaf4e6f427fe40b138bacc6f112dc5bcea4
Signed-off-by: waynedunican <wayne.dunican@est.tech>
Diffstat (limited to 'models-sim')
2 files changed, 6 insertions, 4 deletions
diff --git a/models-sim/policy-models-sim-pdp/src/test/java/org/onap/policy/models/sim/pdp/TestPdpSimulatorConstants.java b/models-sim/policy-models-sim-pdp/src/test/java/org/onap/policy/models/sim/pdp/TestPdpSimulatorConstants.java index ca6562368..bd301740a 100644 --- a/models-sim/policy-models-sim-pdp/src/test/java/org/onap/policy/models/sim/pdp/TestPdpSimulatorConstants.java +++ b/models-sim/policy-models-sim-pdp/src/test/java/org/onap/policy/models/sim/pdp/TestPdpSimulatorConstants.java @@ -34,7 +34,7 @@ import org.junit.jupiter.api.Test; */ class TestPdpSimulatorConstants { @Test - void test() throws Exception { + void test() { // verify that constructor does not throw an exception assertThatCode(() -> { Constructor<PdpSimulatorConstants> c = PdpSimulatorConstants.class.getDeclaredConstructor(); diff --git a/models-sim/policy-models-simulators/src/main/java/org/onap/policy/models/simulators/Main.java b/models-sim/policy-models-simulators/src/main/java/org/onap/policy/models/simulators/Main.java index ce32fd407..dd82c84b2 100644 --- a/models-sim/policy-models-simulators/src/main/java/org/onap/policy/models/simulators/Main.java +++ b/models-sim/policy-models-simulators/src/main/java/org/onap/policy/models/simulators/Main.java @@ -52,6 +52,8 @@ public class Main extends ServiceManagerContainer { private static final String CANNOT_CONNECT = "cannot connect to port "; + private static final String FALSE_STRING = "false"; + @Getter(AccessLevel.PROTECTED) private static Main instance; @@ -185,9 +187,9 @@ public class Main extends ServiceManagerContainer { Boolean.toString(params.isHttps())); props.setProperty(svcpfx + PolicyEndPointProperties.PROPERTY_HTTP_REST_CLASSES_SUFFIX, params.getProviderClass()); - props.setProperty(svcpfx + PolicyEndPointProperties.PROPERTY_MANAGED_SUFFIX, "false"); - props.setProperty(svcpfx + PolicyEndPointProperties.PROPERTY_HTTP_SWAGGER_SUFFIX, "false"); - props.setProperty(svcpfx + PolicyEndPointProperties.PROPERTY_HTTP_SNI_HOST_CHECK_SUFFIX, "false"); + props.setProperty(svcpfx + PolicyEndPointProperties.PROPERTY_MANAGED_SUFFIX, FALSE_STRING); + props.setProperty(svcpfx + PolicyEndPointProperties.PROPERTY_HTTP_SWAGGER_SUFFIX, FALSE_STRING); + props.setProperty(svcpfx + PolicyEndPointProperties.PROPERTY_HTTP_SNI_HOST_CHECK_SUFFIX, FALSE_STRING); props.setProperty(svcpfx + PolicyEndPointProperties.PROPERTY_MANAGED_SUFFIX, "true"); props.setProperty(svcpfx + PolicyEndPointProperties.PROPERTY_HTTP_SERIALIZATION_PROVIDER, String.join(",", |