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 | |
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')
9 files changed, 5 insertions, 182 deletions
diff --git a/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/api/AutomationCompositionElementListener.java b/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/api/AutomationCompositionElementListener.java index 9affd5751..f2832c5b5 100644 --- a/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/api/AutomationCompositionElementListener.java +++ b/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/api/AutomationCompositionElementListener.java @@ -1,6 +1,6 @@ /*- * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation. + * Copyright (C) 2021-2022 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -54,12 +54,4 @@ public interface AutomationCompositionElementListener { public void automationCompositionElementUpdate(ToscaConceptIdentifier automationCompositionId, AutomationCompositionElement element, ToscaNodeTemplate automationCompositionElementDefinition) throws PfModelException; - - /** - * Handle automationCompositionElement statistics. - * - * @param automationCompositionElementId automationCompositionElement id - * @throws PfModelException in case of a model exception - */ - public void handleStatistics(UUID automationCompositionElementId) throws PfModelException; } diff --git a/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/api/ParticipantIntermediaryApi.java b/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/api/ParticipantIntermediaryApi.java index 79f5259bf..754a8305f 100644 --- a/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/api/ParticipantIntermediaryApi.java +++ b/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/api/ParticipantIntermediaryApi.java @@ -1,6 +1,6 @@ /*- * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation. + * Copyright (C) 2021-2022 Nordix Foundation. * Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); @@ -24,14 +24,12 @@ 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.AcElementStatistics; 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.concepts.Participant; 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.models.tosca.authorative.concepts.ToscaConceptIdentifier; import org.onap.policy.models.tosca.authorative.concepts.ToscaProperty; @@ -76,13 +74,6 @@ public interface ParticipantIntermediaryApi { Participant updateParticipantState(ToscaConceptIdentifier definition, ParticipantState state); /** - * Update the statistics of a participant. - * - * @param participantStatistics the statistics of the participant - */ - void updateParticipantStatistics(ParticipantStatistics participantStatistics); - - /** * Get automation compositions from the intermediary API. * * @param name the automation composition element name, null for all @@ -119,12 +110,4 @@ public interface ParticipantIntermediaryApi { AutomationCompositionElement updateAutomationCompositionElementState(ToscaConceptIdentifier automationCompositionId, UUID id, AutomationCompositionOrderedState currentState, AutomationCompositionState newState, ParticipantMessageType messageType); - - /** - * Update the automation composition element statistics. - * - * @param id the ID of the automation composition element to update the state on - * @param elementStatistics the updated statistics - */ - void updateAutomationCompositionElementStatistics(UUID id, AcElementStatistics elementStatistics); } diff --git a/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/api/impl/ParticipantIntermediaryApiImpl.java b/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/api/impl/ParticipantIntermediaryApiImpl.java index 1a1f8500f..e4d921af7 100644 --- a/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/api/impl/ParticipantIntermediaryApiImpl.java +++ b/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/api/impl/ParticipantIntermediaryApiImpl.java @@ -1,6 +1,6 @@ /*- * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation. + * Copyright (C) 2021-2022 Nordix Foundation. * Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); @@ -29,7 +29,6 @@ import org.onap.policy.clamp.acm.participant.intermediary.api.AutomationComposit import org.onap.policy.clamp.acm.participant.intermediary.api.ParticipantIntermediaryApi; import org.onap.policy.clamp.acm.participant.intermediary.handler.AutomationCompositionHandler; import org.onap.policy.clamp.acm.participant.intermediary.handler.ParticipantHandler; -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; @@ -37,7 +36,6 @@ 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.concepts.Participant; 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.models.tosca.authorative.concepts.ToscaConceptIdentifier; import org.onap.policy.models.tosca.authorative.concepts.ToscaProperty; @@ -89,11 +87,6 @@ public class ParticipantIntermediaryApiImpl implements ParticipantIntermediaryAp } @Override - public void updateParticipantStatistics(ParticipantStatistics participantStatistics) { - participantHandler.updateParticipantStatistics(participantStatistics); - } - - @Override public AutomationCompositions getAutomationCompositions(String name, String version) { return automationCompositionHandler.getAutomationCompositions(); } @@ -132,9 +125,4 @@ public class ParticipantIntermediaryApiImpl implements ParticipantIntermediaryAp return automationCompositionHandler.updateAutomationCompositionElementState(automationCompositionId, id, currentState, newState); } - - @Override - public void updateAutomationCompositionElementStatistics(UUID id, AcElementStatistics elementStatistics) { - automationCompositionHandler.updateAutomationCompositionElementStatistics(id, elementStatistics); - } } diff --git a/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/handler/AutomationCompositionHandler.java b/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/handler/AutomationCompositionHandler.java index 7e1fb5443..4c74e50fe 100644 --- a/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/handler/AutomationCompositionHandler.java +++ b/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/handler/AutomationCompositionHandler.java @@ -1,6 +1,6 @@ /*- * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation. + * Copyright (C) 2021-2022 Nordix Foundation. * Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); @@ -32,7 +32,6 @@ import lombok.Getter; import org.onap.policy.clamp.acm.participant.intermediary.api.AutomationCompositionElementListener; import org.onap.policy.clamp.acm.participant.intermediary.comm.ParticipantMessagePublisher; import org.onap.policy.clamp.acm.participant.intermediary.parameters.ParticipantParameters; -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.AutomationCompositionElementAck; @@ -147,21 +146,6 @@ public class AutomationCompositionHandler { } /** - * Handle a automation composition element statistics. - * - * @param id automation composition element id - * @param elementStatistics automation composition element Statistics - */ - public void updateAutomationCompositionElementStatistics(UUID id, AcElementStatistics elementStatistics) { - var acElement = elementsOnThisParticipant.get(id); - if (acElement != null) { - elementStatistics.setParticipantId(participantId); - elementStatistics.setId(id); - acElement.setAcElementStatistics(elementStatistics); - } - } - - /** * Handle a automation composition state change message. * * @param stateChangeMsg the state change message diff --git a/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/handler/ParticipantHandler.java b/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/handler/ParticipantHandler.java index fa02f3dcf..3362f10d3 100644 --- a/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/handler/ParticipantHandler.java +++ b/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/handler/ParticipantHandler.java @@ -1,6 +1,6 @@ /*- * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation. + * Copyright (C) 2021-2022 Nordix Foundation. * ================================================================================ * Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved. * ================================================================================ @@ -22,31 +22,22 @@ package org.onap.policy.clamp.acm.participant.intermediary.handler; -import java.time.Instant; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; import java.util.UUID; -import java.util.stream.Collectors; import lombok.Getter; import lombok.Setter; -import org.onap.policy.clamp.acm.participant.intermediary.api.AutomationCompositionElementListener; import org.onap.policy.clamp.acm.participant.intermediary.comm.ParticipantMessagePublisher; import org.onap.policy.clamp.acm.participant.intermediary.parameters.ParticipantParameters; -import org.onap.policy.clamp.models.acm.concepts.AcElementStatisticsList; -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.AutomationCompositionElementDefinition; import org.onap.policy.clamp.models.acm.concepts.AutomationCompositionInfo; -import org.onap.policy.clamp.models.acm.concepts.AutomationCompositionStatistics; -import org.onap.policy.clamp.models.acm.concepts.AutomationCompositions; import org.onap.policy.clamp.models.acm.concepts.Participant; import org.onap.policy.clamp.models.acm.concepts.ParticipantDefinition; 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.AutomationCompositionStateChange; import org.onap.policy.clamp.models.acm.messages.dmaap.participant.AutomationCompositionUpdate; import org.onap.policy.clamp.models.acm.messages.dmaap.participant.ParticipantAckMessage; @@ -59,7 +50,6 @@ import org.onap.policy.clamp.models.acm.messages.dmaap.participant.ParticipantSt import org.onap.policy.clamp.models.acm.messages.dmaap.participant.ParticipantStatusReq; import org.onap.policy.clamp.models.acm.messages.dmaap.participant.ParticipantUpdate; import org.onap.policy.clamp.models.acm.messages.dmaap.participant.ParticipantUpdateAck; -import org.onap.policy.models.base.PfModelException; import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier; import org.onap.policy.models.tosca.authorative.concepts.ToscaProperty; import org.slf4j.Logger; @@ -80,7 +70,6 @@ public class ParticipantHandler { private final ToscaConceptIdentifier participantId; private final AutomationCompositionHandler automationCompositionHandler; - private final ParticipantStatistics participantStatistics; private final ParticipantMessagePublisher publisher; @Setter @@ -103,11 +92,6 @@ public class ParticipantHandler { this.participantId = parameters.getIntermediaryParameters().getParticipantId(); this.publisher = publisher; this.automationCompositionHandler = automationCompositionHandler; - this.participantStatistics = new ParticipantStatistics(); - this.participantStatistics.setParticipantId(participantId); - this.participantStatistics.setState(state); - this.participantStatistics.setHealthStatus(healthStatus); - this.participantStatistics.setTimeStamp(Instant.now()); } /** @@ -121,29 +105,6 @@ public class ParticipantHandler { } /** - * Update AutomationCompositionElement statistics. The automation composition elements listening will be - * notified to retrieve statistics from respective automation composition elements, and automation - * compositionelements - * data on the handler will be updated. - * - * @param automationCompositions the automation compositions - * @param acElementListener automation composition element listener - */ - private void updateAcElementStatistics(AutomationCompositions automationCompositions, - AutomationCompositionElementListener acElementListener) { - for (AutomationComposition automationComposition : automationCompositions.getAutomationCompositionList()) { - for (AutomationCompositionElement element : automationComposition.getElements().values()) { - try { - acElementListener.handleStatistics(element.getId()); - } catch (PfModelException e) { - LOGGER.debug("Getting statistics for automation composition element failed for element ID {}", - element.getId(), e); - } - } - } - } - - /** * Handle a automation composition update message. * * @param updateMsg the update message @@ -193,19 +154,6 @@ public class ParticipantHandler { } /** - * Method to update participant statistics. - * - * @param statistics participant statistics - */ - public void updateParticipantStatistics(ParticipantStatistics statistics) { - participantStatistics.setState(statistics.getState()); - participantStatistics.setHealthStatus(statistics.getHealthStatus()); - participantStatistics.setTimeStamp(statistics.getTimeStamp()); - participantStatistics.setAverageExecutionTime(statistics.getAverageExecutionTime()); - participantStatistics.setEventCount(statistics.getEventCount()); - } - - /** * Get participants as a {@link Participant} class. * * @param name the participant name to get @@ -366,19 +314,8 @@ public class ParticipantHandler { * Method to send heartbeat to automation composition runtime. */ public ParticipantStatus makeHeartbeat(boolean responseToParticipantStatusReq) { - if (!responseToParticipantStatusReq) { - var automationCompositions = automationCompositionHandler.getAutomationCompositions(); - for (var acElementListener : automationCompositionHandler.getListeners()) { - updateAcElementStatistics(automationCompositions, acElementListener); - } - } - this.participantStatistics.setState(state); - this.participantStatistics.setHealthStatus(healthStatus); - this.participantStatistics.setTimeStamp(Instant.now()); - var heartbeat = new ParticipantStatus(); heartbeat.setParticipantId(participantId); - heartbeat.setParticipantStatistics(participantStatistics); heartbeat.setParticipantType(participantType); heartbeat.setHealthStatus(healthStatus); heartbeat.setState(state); @@ -400,14 +337,6 @@ public class ParticipantHandler { for (var entry : automationCompositionHandler.getAutomationCompositionMap().entrySet()) { var acInfo = new AutomationCompositionInfo(); acInfo.setAutomationCompositionId(entry.getKey()); - var acStatitistics = new AutomationCompositionStatistics(); - acStatitistics.setAutomationCompositionId(entry.getKey()); - var acElementStatisticsList = new AcElementStatisticsList(); - acElementStatisticsList.setAcElementStatistics(entry.getValue().getElements().values().stream() - .map(AutomationCompositionElement::getAcElementStatistics).filter(Objects::nonNull) - .collect(Collectors.toList())); - acStatitistics.setAcElementStatisticsList(acElementStatisticsList); - acInfo.setAutomationCompositionStatistics(acStatitistics); acInfo.setState(entry.getValue().getState()); automationCompositionInfoList.add(acInfo); } 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; |