aboutsummaryrefslogtreecommitdiffstats
path: root/participant
diff options
context:
space:
mode:
authorFrancescoFioraEst <francesco.fiora@est.tech>2024-06-17 13:23:07 +0100
committerFrancesco Fiora <francesco.fiora@est.tech>2024-06-17 13:36:52 +0000
commit45b94ba92d2ea581f1415ee57a005383bc6629e1 (patch)
tree0a4795f7cc58f7db9516031511df4809114e95aa /participant
parent8c76c17a2d589d4e94571f4b6dce40261c0bb62d (diff)
Improve code in ACM
Code clean-up on ACM: remove unused imports, remove updateParticipant method (duplicated method) and remove public in Unit test classes. Issue-ID: POLICY-5047 Change-Id: I308815cacaa2c5ce81ed54c676d3d5e26778f0f6 Signed-off-by: FrancescoFioraEst <francesco.fiora@est.tech>
Diffstat (limited to 'participant')
-rw-r--r--participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/api/CompositionDto.java2
-rw-r--r--participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/api/InstanceElementDto.java2
-rw-r--r--participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/comm/ParticipantCommTest.java5
-rw-r--r--participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/handler/AcDefinitionHandlerTest.java2
-rw-r--r--participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/handler/IntermediaryActivatorTest.java2
5 files changed, 3 insertions, 10 deletions
diff --git a/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/api/CompositionDto.java b/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/api/CompositionDto.java
index 88f080bc7..4902a9efb 100644
--- a/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/api/CompositionDto.java
+++ b/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/api/CompositionDto.java
@@ -20,10 +20,8 @@
package org.onap.policy.clamp.acm.participant.intermediary.api;
-import java.util.List;
import java.util.Map;
import java.util.UUID;
-import org.onap.policy.clamp.models.acm.concepts.AutomationCompositionElementDefinition;
import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
public record CompositionDto(UUID compositionId,
diff --git a/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/api/InstanceElementDto.java b/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/api/InstanceElementDto.java
index 197d7e46d..297af6c43 100644
--- a/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/api/InstanceElementDto.java
+++ b/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/api/InstanceElementDto.java
@@ -22,8 +22,6 @@ package org.onap.policy.clamp.acm.participant.intermediary.api;
import java.util.Map;
import java.util.UUID;
-import org.onap.policy.clamp.models.acm.messages.rest.instantiation.DeployOrder;
-import org.onap.policy.clamp.models.acm.messages.rest.instantiation.LockOrder;
import org.onap.policy.models.tosca.authorative.concepts.ToscaServiceTemplate;
public record InstanceElementDto(UUID instanceId, UUID elementId, ToscaServiceTemplate toscaServiceTemplateFragment,
diff --git a/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/comm/ParticipantCommTest.java b/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/comm/ParticipantCommTest.java
index d7c97bd00..33325122e 100644
--- a/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/comm/ParticipantCommTest.java
+++ b/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/comm/ParticipantCommTest.java
@@ -42,12 +42,11 @@ import org.onap.policy.clamp.models.acm.messages.kafka.participant.ParticipantRe
import org.onap.policy.clamp.models.acm.messages.kafka.participant.ParticipantStatus;
import org.onap.policy.clamp.models.acm.messages.kafka.participant.ParticipantStatusReq;
import org.onap.policy.common.endpoints.event.comm.TopicSink;
-import org.onap.policy.common.utils.coder.CoderException;
class ParticipantCommTest {
@Test
- void participantListenerTest() throws CoderException {
+ void participantListenerTest() {
var participantHandler = mock(ParticipantHandler.class);
var participantRegisterAckListener = new ParticipantRegisterAckListener(participantHandler);
@@ -137,7 +136,7 @@ class ParticipantCommTest {
}
@Test
- void messageSenderTest() throws CoderException {
+ void messageSenderTest() {
var participantHandler = mock(ParticipantHandler.class);
var participantParameters = CommonTestData.getParticipantParameters();
var messageSender = new MessageSender(participantHandler, participantParameters);
diff --git a/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/handler/AcDefinitionHandlerTest.java b/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/handler/AcDefinitionHandlerTest.java
index 3bbdc3dbf..0c73e87ed 100644
--- a/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/handler/AcDefinitionHandlerTest.java
+++ b/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/handler/AcDefinitionHandlerTest.java
@@ -40,7 +40,7 @@ import org.onap.policy.clamp.models.acm.messages.kafka.participant.ParticipantPr
import org.onap.policy.clamp.models.acm.messages.kafka.participant.ParticipantRestart;
import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
-public class AcDefinitionHandlerTest {
+class AcDefinitionHandlerTest {
@Test
void handleComposiotPrimeTest() {
diff --git a/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/handler/IntermediaryActivatorTest.java b/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/handler/IntermediaryActivatorTest.java
index 8868c733a..89bafa196 100644
--- a/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/handler/IntermediaryActivatorTest.java
+++ b/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/handler/IntermediaryActivatorTest.java
@@ -34,10 +34,8 @@ import static org.mockito.Mockito.when;
import java.util.List;
import org.junit.jupiter.api.Test;
import org.onap.policy.clamp.acm.participant.intermediary.comm.ParticipantStatusReqListener;
-import org.onap.policy.clamp.acm.participant.intermediary.comm.ParticipantSyncListener;
import org.onap.policy.clamp.acm.participant.intermediary.main.parameters.CommonTestData;
import org.onap.policy.clamp.models.acm.messages.kafka.participant.ParticipantStatusReq;
-import org.onap.policy.clamp.models.acm.messages.kafka.participant.ParticipantSync;
import org.onap.policy.common.utils.coder.Coder;
import org.onap.policy.common.utils.coder.StandardCoder;
import org.onap.policy.common.utils.coder.StandardCoderObject;