diff options
author | FrancescoFioraEst <francesco.fiora@est.tech> | 2022-10-26 16:29:50 +0100 |
---|---|---|
committer | Francesco Fiora <francesco.fiora@est.tech> | 2022-10-28 07:51:45 +0000 |
commit | 6cec34379cf6f1ca1ff69cd2c8973937d896aa62 (patch) | |
tree | 5b6f1de4da2e5f974757a74ecd351dfd657d85c6 /participant/participant-intermediary/src/test/java/org/onap | |
parent | 75a69e67d03a55d3961d0f6a9f7925868dd39aa6 (diff) |
Remove old implementation of statistics in ACM participants
The old implementation of statistics in ACM-participants
can be removed due the Prometheus metrics support.
Issue-ID: POLICY-4420
Change-Id: I0785b269614aba51f94e71a3fe931541c1918b0c
Signed-off-by: FrancescoFioraEst <francesco.fiora@est.tech>
Diffstat (limited to 'participant/participant-intermediary/src/test/java/org/onap')
4 files changed, 0 insertions, 53 deletions
diff --git a/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/api/impl/ParticipantIntermediaryApiImplTest.java b/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/api/impl/ParticipantIntermediaryApiImplTest.java index a8116c078..0d631ad04 100644 --- a/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/api/impl/ParticipantIntermediaryApiImplTest.java +++ b/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/api/impl/ParticipantIntermediaryApiImplTest.java @@ -25,18 +25,14 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNotNull; -import java.time.Instant; import java.util.UUID; import org.junit.jupiter.api.Test; import org.mockito.Mockito; import org.onap.policy.clamp.acm.participant.intermediary.api.AutomationCompositionElementListener; import org.onap.policy.clamp.acm.participant.intermediary.main.parameters.CommonTestData; -import org.onap.policy.clamp.models.acm.concepts.AcElementStatistics; import org.onap.policy.clamp.models.acm.concepts.AutomationCompositionOrderedState; import org.onap.policy.clamp.models.acm.concepts.AutomationCompositionState; -import org.onap.policy.clamp.models.acm.concepts.ParticipantHealthStatus; import org.onap.policy.clamp.models.acm.concepts.ParticipantState; -import org.onap.policy.clamp.models.acm.concepts.ParticipantStatistics; import org.onap.policy.clamp.models.acm.messages.dmaap.participant.ParticipantMessageType; import org.onap.policy.common.utils.coder.CoderException; import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier; @@ -66,13 +62,6 @@ class ParticipantIntermediaryApiImplTest { assertNotNull(apiImpl.getAutomationCompositions(id.getName(), id.getVersion())); assertThat(apiImpl.getAcElementDefinitionCommonProperties(id)).isEmpty(); - var participantStatistics = new ParticipantStatistics(); - participantStatistics.setParticipantId(id); - participantStatistics.setTimeStamp(Instant.ofEpochMilli(123456L)); - participantStatistics.setState(ParticipantState.PASSIVE); - participantStatistics.setHealthStatus(ParticipantHealthStatus.HEALTHY); - apiImpl.updateParticipantStatistics(participantStatistics); - var participants = apiImpl.getParticipants(id.getName(), id.getVersion()); assertEquals(ParticipantState.UNKNOWN, participants.get(0).getParticipantState()); @@ -86,13 +75,6 @@ class ParticipantIntermediaryApiImplTest { var idType = new ToscaConceptIdentifier(ID_NAME_TYPE, ID_VERSION_TYPE); assertEquals(idType, element.getParticipantType()); - var acElementStatistics = new AcElementStatistics(); - var automationCompositionId = new ToscaConceptIdentifier("defName", "0.0.1"); - acElementStatistics.setParticipantId(automationCompositionId); - acElementStatistics.setState(AutomationCompositionState.RUNNING); - acElementStatistics.setTimeStamp(Instant.now()); - - apiImpl.updateAutomationCompositionElementStatistics(uuid, acElementStatistics); var acElement = apiImpl.updateAutomationCompositionElementState(id, uuid, AutomationCompositionOrderedState.UNINITIALISED, AutomationCompositionState.PASSIVE, ParticipantMessageType.AUTOMATION_COMPOSITION_STATECHANGE_ACK); diff --git a/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/handler/AutomationCompositionHandlerTest.java b/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/handler/AutomationCompositionHandlerTest.java index c8432f230..06b4256a7 100644 --- a/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/handler/AutomationCompositionHandlerTest.java +++ b/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/handler/AutomationCompositionHandlerTest.java @@ -23,7 +23,6 @@ package org.onap.policy.clamp.acm.participant.intermediary.handler; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNotEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNull; import static org.mockito.Mockito.mock; @@ -35,7 +34,6 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.onap.policy.clamp.acm.participant.intermediary.api.AutomationCompositionElementListener; import org.onap.policy.clamp.acm.participant.intermediary.main.parameters.CommonTestData; -import org.onap.policy.clamp.models.acm.concepts.AcElementStatistics; import org.onap.policy.clamp.models.acm.concepts.AutomationCompositionElement; import org.onap.policy.clamp.models.acm.concepts.AutomationCompositionElementDefinition; import org.onap.policy.clamp.models.acm.concepts.AutomationCompositionOrderedState; @@ -84,16 +82,6 @@ class AutomationCompositionHandlerTest { assertNull(ach.updateAutomationCompositionElementState(null, id, AutomationCompositionOrderedState.UNINITIALISED, AutomationCompositionState.PASSIVE)); - - var acElementStatistics = new AcElementStatistics(); - var automationCompositionId = new ToscaConceptIdentifier("defName", "0.0.1"); - acElementStatistics.setParticipantId(automationCompositionId); - acElementStatistics.setState(AutomationCompositionState.RUNNING); - acElementStatistics.setTimeStamp(Instant.now()); - - ach.updateAutomationCompositionElementStatistics(id, acElementStatistics); - assertNull(ach.updateAutomationCompositionElementState(automationCompositionId, id, - AutomationCompositionOrderedState.UNINITIALISED, AutomationCompositionState.PASSIVE)); } @Test @@ -114,15 +102,6 @@ class AutomationCompositionHandlerTest { AutomationCompositionState.RUNNING); assertEquals(AutomationCompositionState.RUNNING, value.getState()); - var acElementStatistics = new AcElementStatistics(); - acElementStatistics.setParticipantId(id); - acElementStatistics.setState(AutomationCompositionState.RUNNING); - acElementStatistics.setTimeStamp(Instant.now()); - - assertNotEquals(uuid, value.getAcElementStatistics().getId()); - ach.updateAutomationCompositionElementStatistics(uuid, acElementStatistics); - assertEquals(uuid, value.getAcElementStatistics().getId()); - ach.getElementsOnThisParticipant().remove(key, value); ach.getAutomationCompositionMap().values().iterator().next().getElements().clear(); assertNull(ach.updateAutomationCompositionElementState(id, key, AutomationCompositionOrderedState.PASSIVE, diff --git a/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/handler/ParticipantHandlerTest.java b/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/handler/ParticipantHandlerTest.java index 04742d8b3..a87d8e1aa 100644 --- a/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/handler/ParticipantHandlerTest.java +++ b/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/handler/ParticipantHandlerTest.java @@ -88,7 +88,6 @@ class ParticipantHandlerTest { var heartbeatF = participantHandler.makeHeartbeat(false); assertEquals(id, heartbeatF.getParticipantId()); - assertEquals(ParticipantState.UNKNOWN, heartbeatF.getParticipantStatistics().getState()); assertThat(heartbeatF.getAutomationCompositionInfoList()).isEmpty(); participantHandler.handleParticipantUpdate(participantUpdateMsg); @@ -96,7 +95,6 @@ class ParticipantHandlerTest { var heartbeatT = participantHandler.makeHeartbeat(true); assertEquals(id, heartbeatT.getParticipantId()); - assertEquals(ParticipantState.TERMINATED, heartbeatT.getParticipantStatistics().getState()); assertThat(heartbeatT.getParticipantDefinitionUpdates()).isNotEmpty(); assertEquals(id, heartbeatT.getParticipantDefinitionUpdates().get(0).getParticipantId()); @@ -104,8 +102,6 @@ class ParticipantHandlerTest { participantHandler.handleParticipantUpdate(pum); var heartbeatTAfterUpdate = participantHandler.makeHeartbeat(true); assertEquals(id, heartbeatTAfterUpdate.getParticipantId()); - assertEquals(ParticipantState.PASSIVE, heartbeatTAfterUpdate.getParticipantStatistics().getState()); - } private ParticipantUpdate setListParticipantDefinition(ParticipantUpdate participantUpdateMsg) { diff --git a/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/main/parameters/CommonTestData.java b/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/main/parameters/CommonTestData.java index a5aa2f48a..91552ee34 100644 --- a/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/main/parameters/CommonTestData.java +++ b/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/main/parameters/CommonTestData.java @@ -21,7 +21,6 @@ package org.onap.policy.clamp.acm.participant.intermediary.main.parameters; import java.io.File; -import java.time.Instant; import java.util.Collections; import java.util.LinkedHashMap; import java.util.List; @@ -34,11 +33,9 @@ import org.onap.policy.clamp.acm.participant.intermediary.handler.AutomationComp import org.onap.policy.clamp.acm.participant.intermediary.handler.DummyParticipantParameters; import org.onap.policy.clamp.acm.participant.intermediary.handler.ParticipantHandler; import org.onap.policy.clamp.acm.participant.intermediary.parameters.ParticipantIntermediaryParameters; -import org.onap.policy.clamp.models.acm.concepts.AcElementStatistics; import org.onap.policy.clamp.models.acm.concepts.AutomationComposition; import org.onap.policy.clamp.models.acm.concepts.AutomationCompositionElement; import org.onap.policy.clamp.models.acm.concepts.AutomationCompositionOrderedState; -import org.onap.policy.clamp.models.acm.concepts.AutomationCompositionState; import org.onap.policy.clamp.models.acm.concepts.AutomationCompositions; import org.onap.policy.clamp.models.acm.messages.dmaap.participant.ParticipantDeregisterAck; import org.onap.policy.common.endpoints.event.comm.TopicSink; @@ -256,13 +253,6 @@ public class CommonTestData { acElement.setDefinition(id); acElement.setOrderedState(AutomationCompositionOrderedState.UNINITIALISED); - var acElementStatistics = new AcElementStatistics(); - acElementStatistics.setParticipantId(id); - acElementStatistics.setState(AutomationCompositionState.UNINITIALISED); - acElementStatistics.setTimeStamp(Instant.now()); - - acElement.setAcElementStatistics(acElementStatistics); - Map<UUID, AutomationCompositionElement> elementsOnThisParticipant = new LinkedHashMap<>(); elementsOnThisParticipant.put(uuid, acElement); return elementsOnThisParticipant; |