diff options
author | 2024-07-23 09:23:51 +0100 | |
---|---|---|
committer | 2024-08-13 08:49:10 +0100 | |
commit | b7804abcf865dc58a01bed3f2be4756e731d9288 (patch) | |
tree | 7f6fc3b50622578bb8612de9fe5e5c6adddfaf28 /models-interactions/model-actors/actor.so/src/test | |
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-interactions/model-actors/actor.so/src/test')
5 files changed, 8 insertions, 8 deletions
diff --git a/models-interactions/model-actors/actor.so/src/test/java/org/onap/policy/controlloop/actor/so/ModifyCllTest.java b/models-interactions/model-actors/actor.so/src/test/java/org/onap/policy/controlloop/actor/so/ModifyCllTest.java index ff1a93b85..0edc7d374 100644 --- a/models-interactions/model-actors/actor.so/src/test/java/org/onap/policy/controlloop/actor/so/ModifyCllTest.java +++ b/models-interactions/model-actors/actor.so/src/test/java/org/onap/policy/controlloop/actor/so/ModifyCllTest.java @@ -110,7 +110,7 @@ class ModifyCllTest extends BasicSoOperation { * Tests makeRequest() when a property is missing. */ @Test - void testMakeRequestMissingProperty() throws Exception { + void testMakeRequestMissingProperty() { oper = new ModifyCll(params, config); assertThatIllegalStateException().isThrownBy(() -> oper.makeRequest()) diff --git a/models-interactions/model-actors/actor.so/src/test/java/org/onap/policy/controlloop/actor/so/ModifyNssiTest.java b/models-interactions/model-actors/actor.so/src/test/java/org/onap/policy/controlloop/actor/so/ModifyNssiTest.java index c5c183275..4db3ca308 100644 --- a/models-interactions/model-actors/actor.so/src/test/java/org/onap/policy/controlloop/actor/so/ModifyNssiTest.java +++ b/models-interactions/model-actors/actor.so/src/test/java/org/onap/policy/controlloop/actor/so/ModifyNssiTest.java @@ -110,7 +110,7 @@ class ModifyNssiTest extends BasicSoOperation { * Tests makeRequest() when a property is missing. */ @Test - void testMakeRequestMissingProperty() throws Exception { + void testMakeRequestMissingProperty() { oper = new ModifyNssi(params, config); assertThatIllegalStateException().isThrownBy(() -> oper.makeRequest()) diff --git a/models-interactions/model-actors/actor.so/src/test/java/org/onap/policy/controlloop/actor/so/SoOperationTest.java b/models-interactions/model-actors/actor.so/src/test/java/org/onap/policy/controlloop/actor/so/SoOperationTest.java index fe88a2371..f04708210 100644 --- a/models-interactions/model-actors/actor.so/src/test/java/org/onap/policy/controlloop/actor/so/SoOperationTest.java +++ b/models-interactions/model-actors/actor.so/src/test/java/org/onap/policy/controlloop/actor/so/SoOperationTest.java @@ -212,7 +212,7 @@ import org.onap.policy.so.SoResponse; } @Test - void testConstructCloudConfiguration() throws Exception { + void testConstructCloudConfiguration() { Tenant tenantItem = new Tenant(); tenantItem.setTenantId("my-tenant-id"); @@ -235,7 +235,7 @@ import org.onap.policy.so.SoResponse; } @Test - void testGetRequiredText() throws Exception { + void testGetRequiredText() { assertThatCode(() -> oper.getRequiredText("some value", "my value")).doesNotThrowAnyException(); diff --git a/models-interactions/model-actors/actor.so/src/test/java/org/onap/policy/controlloop/actor/so/VfModuleCreateTest.java b/models-interactions/model-actors/actor.so/src/test/java/org/onap/policy/controlloop/actor/so/VfModuleCreateTest.java index 721cb6a6d..d1b2c0747 100644 --- a/models-interactions/model-actors/actor.so/src/test/java/org/onap/policy/controlloop/actor/so/VfModuleCreateTest.java +++ b/models-interactions/model-actors/actor.so/src/test/java/org/onap/policy/controlloop/actor/so/VfModuleCreateTest.java @@ -221,7 +221,7 @@ class VfModuleCreateTest extends BasicSoOperation { * Tests makeRequest() when a property is missing. */ @Test - void testMakeRequestMissingProperty() throws Exception { + void testMakeRequestMissingProperty() { loadProperties(); ServiceInstance instance = new ServiceInstance(); diff --git a/models-interactions/model-actors/actor.so/src/test/java/org/onap/policy/controlloop/actor/so/VfModuleDeleteTest.java b/models-interactions/model-actors/actor.so/src/test/java/org/onap/policy/controlloop/actor/so/VfModuleDeleteTest.java index 5ece1968d..208db3f57 100644 --- a/models-interactions/model-actors/actor.so/src/test/java/org/onap/policy/controlloop/actor/so/VfModuleDeleteTest.java +++ b/models-interactions/model-actors/actor.so/src/test/java/org/onap/policy/controlloop/actor/so/VfModuleDeleteTest.java @@ -277,7 +277,7 @@ class VfModuleDeleteTest extends BasicSoOperation { */ @Test @SuppressWarnings("unchecked") - void testDeleteException() throws Exception { + void testDeleteException() { Throwable thrown = new IllegalStateException(EXPECTED_EXCEPTION); // need a new future, with an exception @@ -360,7 +360,7 @@ class VfModuleDeleteTest extends BasicSoOperation { * Tests makeRequest() when a property is missing. */ @Test - void testMakeRequestMissingProperty() throws Exception { + void testMakeRequestMissingProperty() { loadProperties(); ServiceInstance instance = new ServiceInstance(); @@ -381,7 +381,7 @@ class VfModuleDeleteTest extends BasicSoOperation { } @SuppressWarnings("unchecked") - private void configureResponse(String responseText) throws CoderException { + private void configureResponse(String responseText) { // indicate that the response was completed lenient().when(javaResp.statusCode()).thenReturn(200); lenient().when(javaResp.body()).thenReturn(responseText); |