aboutsummaryrefslogtreecommitdiffstats
path: root/models-interactions/model-actors/actor.so/src
diff options
context:
space:
mode:
authorwaynedunican <wayne.dunican@est.tech>2024-07-23 09:23:51 +0100
committerwaynedunican <wayne.dunican@est.tech>2024-08-13 08:49:10 +0100
commitb7804abcf865dc58a01bed3f2be4756e731d9288 (patch)
tree7f6fc3b50622578bb8612de9fe5e5c6adddfaf28 /models-interactions/model-actors/actor.so/src
parenta029ccab07f2dd71286804da620c513da9fdfc0e (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')
-rw-r--r--models-interactions/model-actors/actor.so/src/main/java/org/onap/policy/controlloop/actor/so/RestManagerResponse.java1
-rw-r--r--models-interactions/model-actors/actor.so/src/main/java/org/onap/policy/controlloop/actor/so/VfModuleDelete.java9
-rw-r--r--models-interactions/model-actors/actor.so/src/test/java/org/onap/policy/controlloop/actor/so/ModifyCllTest.java2
-rw-r--r--models-interactions/model-actors/actor.so/src/test/java/org/onap/policy/controlloop/actor/so/ModifyNssiTest.java2
-rw-r--r--models-interactions/model-actors/actor.so/src/test/java/org/onap/policy/controlloop/actor/so/SoOperationTest.java4
-rw-r--r--models-interactions/model-actors/actor.so/src/test/java/org/onap/policy/controlloop/actor/so/VfModuleCreateTest.java2
-rw-r--r--models-interactions/model-actors/actor.so/src/test/java/org/onap/policy/controlloop/actor/so/VfModuleDeleteTest.java6
7 files changed, 9 insertions, 17 deletions
diff --git a/models-interactions/model-actors/actor.so/src/main/java/org/onap/policy/controlloop/actor/so/RestManagerResponse.java b/models-interactions/model-actors/actor.so/src/main/java/org/onap/policy/controlloop/actor/so/RestManagerResponse.java
index 129305d99..57c3f7ee2 100644
--- a/models-interactions/model-actors/actor.so/src/main/java/org/onap/policy/controlloop/actor/so/RestManagerResponse.java
+++ b/models-interactions/model-actors/actor.so/src/main/java/org/onap/policy/controlloop/actor/so/RestManagerResponse.java
@@ -46,7 +46,6 @@ import org.onap.policy.common.utils.coder.CoderException;
*/
@AllArgsConstructor
public class RestManagerResponse extends Response {
- // TODO move to actorServices
@Getter
private final int status;
diff --git a/models-interactions/model-actors/actor.so/src/main/java/org/onap/policy/controlloop/actor/so/VfModuleDelete.java b/models-interactions/model-actors/actor.so/src/main/java/org/onap/policy/controlloop/actor/so/VfModuleDelete.java
index 8076fbcb9..4ef0a7ba9 100644
--- a/models-interactions/model-actors/actor.so/src/main/java/org/onap/policy/controlloop/actor/so/VfModuleDelete.java
+++ b/models-interactions/model-actors/actor.so/src/main/java/org/onap/policy/controlloop/actor/so/VfModuleDelete.java
@@ -4,7 +4,7 @@
* ================================================================================
* Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
* Modifications Copyright (C) 2020 Wipro Limited.
- * Modifications Copyright (C) 2023 Nordix Foundation.
+ * Modifications Copyright (C) 2023-2024 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -121,7 +121,6 @@ public class VfModuleDelete extends SoOperation {
*/
protected CompletableFuture<Response> delete(String uri, Map<String, Object> headers, String contentType,
String request, InvocationCallback<Response> callback) {
- // TODO move to HttpOperation
final String url = getClient().getBaseUrl() + uri;
@@ -163,7 +162,6 @@ public class VfModuleDelete extends SoOperation {
* @return the builder
*/
protected Builder addAuthHeader(Builder builder) {
- // TODO move to HttpOperation
final HttpClient client = getClient();
String username = client.getUserName();
if (StringUtils.isBlank(username)) {
@@ -229,11 +227,6 @@ public class VfModuleDelete extends SoOperation {
// requestInfo
details.setRequestInfo(constructRequestInfo());
- /*
- * TODO the legacy SO code always passes null for the last argument, though it
- * should be passing the vfModuleInstanceId
- */
-
// compute the path
String svcId = getRequiredText("service instance ID", vnfServiceItem.getServiceInstanceId());
String path = PATH_PREFIX + svcId + "/vnfs/" + vnfItem.getVnfId() + "/vfModules/null";
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);