From b7804abcf865dc58a01bed3f2be4756e731d9288 Mon Sep 17 00:00:00 2001 From: waynedunican Date: Tue, 23 Jul 2024 09:23:51 +0100 Subject: 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 --- .../controlloop/actor/sdnc/BandwidthOnDemandOperationTest.java | 6 +++--- .../org/onap/policy/controlloop/actor/sdnc/BasicSdncOperation.java | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'models-interactions/model-actors/actor.sdnc') diff --git a/models-interactions/model-actors/actor.sdnc/src/test/java/org/onap/policy/controlloop/actor/sdnc/BandwidthOnDemandOperationTest.java b/models-interactions/model-actors/actor.sdnc/src/test/java/org/onap/policy/controlloop/actor/sdnc/BandwidthOnDemandOperationTest.java index 3510c4a67..09ca68434 100644 --- a/models-interactions/model-actors/actor.sdnc/src/test/java/org/onap/policy/controlloop/actor/sdnc/BandwidthOnDemandOperationTest.java +++ b/models-interactions/model-actors/actor.sdnc/src/test/java/org/onap/policy/controlloop/actor/sdnc/BandwidthOnDemandOperationTest.java @@ -129,7 +129,7 @@ class BandwidthOnDemandOperationTest extends BasicSdncOperation { */ @Test - void testMakeRequestMissingBandwidth() throws Exception { + void testMakeRequestMissingBandwidth() { oper = new BandwidthOnDemandOperation(params, config); oper.setProperty(OperationProperties.ENRICHMENT_SERVICE_ID, MY_SERVICE); oper.setProperty(OperationProperties.ENRICHMENT_BANDWIDTH_CHANGE_TIME, MY_CHANGE_TIME); @@ -143,7 +143,7 @@ class BandwidthOnDemandOperationTest extends BasicSdncOperation { } @Test - void testMakeRequestMissingBandwidthChangeTime() throws Exception { + void testMakeRequestMissingBandwidthChangeTime() { oper = new BandwidthOnDemandOperation(params, config); oper.setProperty(OperationProperties.ENRICHMENT_SERVICE_ID, MY_SERVICE); oper.setProperty(OperationProperties.ENRICHMENT_BANDWIDTH, MY_BANDWIDTH); @@ -157,7 +157,7 @@ class BandwidthOnDemandOperationTest extends BasicSdncOperation { } @Test - void testMakeRequestMissingVnfId() throws Exception { + void testMakeRequestMissingVnfId() { oper = new BandwidthOnDemandOperation(params, config); oper.setProperty(OperationProperties.ENRICHMENT_SERVICE_ID, MY_SERVICE); oper.setProperty(OperationProperties.ENRICHMENT_BANDWIDTH, MY_BANDWIDTH); diff --git a/models-interactions/model-actors/actor.sdnc/src/test/java/org/onap/policy/controlloop/actor/sdnc/BasicSdncOperation.java b/models-interactions/model-actors/actor.sdnc/src/test/java/org/onap/policy/controlloop/actor/sdnc/BasicSdncOperation.java index cfdec987d..5dee02fcb 100644 --- a/models-interactions/model-actors/actor.sdnc/src/test/java/org/onap/policy/controlloop/actor/sdnc/BasicSdncOperation.java +++ b/models-interactions/model-actors/actor.sdnc/src/test/java/org/onap/policy/controlloop/actor/sdnc/BasicSdncOperation.java @@ -112,7 +112,7 @@ abstract class BasicSdncOperation extends BasicHttpOperation { * @return the request that was posted */ protected SdncRequest verifyOperation(SdncOperation operation) - throws InterruptedException, ExecutionException, TimeoutException, CoderException { + throws InterruptedException, ExecutionException, CoderException { CompletableFuture future2 = operation.start(); executor.runAll(100); -- cgit 1.2.3-korg