aboutsummaryrefslogtreecommitdiffstats
path: root/participant
diff options
context:
space:
mode:
Diffstat (limited to 'participant')
-rw-r--r--participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/handler/CacheProvider.java2
-rw-r--r--participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/handler/CacheProviderTest.java6
2 files changed, 7 insertions, 1 deletions
diff --git a/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/handler/CacheProvider.java b/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/handler/CacheProvider.java
index b9e33c92d..c6915026a 100644
--- a/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/handler/CacheProvider.java
+++ b/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/handler/CacheProvider.java
@@ -305,7 +305,7 @@ public class CacheProvider {
var definitions = acElementsDefinitions.get(compositionId);
Map<UUID, CompositionElementDto> map = new HashMap<>();
for (var element : automationComposition.getElements().values()) {
- var definition = getAcElementDefinition(definitions, element.getDefinition());
+ var definition = definitions.get(element.getDefinition());
var compositionElement = (definition != null)
? new CompositionElementDto(compositionId, element.getDefinition(),
definition.getAutomationCompositionElementToscaNodeTemplate().getProperties(),
diff --git a/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/handler/CacheProviderTest.java b/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/handler/CacheProviderTest.java
index 96add2025..1d4e3dff3 100644
--- a/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/handler/CacheProviderTest.java
+++ b/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/handler/CacheProviderTest.java
@@ -27,6 +27,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
import java.util.Map;
import java.util.UUID;
import org.junit.jupiter.api.Test;
+import org.onap.policy.clamp.acm.participant.intermediary.api.ElementState;
import org.onap.policy.clamp.acm.participant.intermediary.main.parameters.CommonTestData;
import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
@@ -203,7 +204,12 @@ class CacheProviderTest {
for (var element : automationComposition.getElements().values()) {
var compositionElementDto = result.get(element.getId());
assertEquals(element.getDefinition(), compositionElementDto.elementDefinitionId());
+ assertEquals(ElementState.PRESENT, result.get(element.getId()).state());
}
+ var element = automationComposition.getElements().values().iterator().next();
+ element.setDefinition(new ToscaConceptIdentifier("NotExist", "0.0.0"));
+ result = cacheProvider.getCompositionElementDtoMap(automationComposition);
+ assertEquals(ElementState.NOT_PRESENT, result.get(element.getId()).state());
}
@Test