From 632899642b6a1d1489a0b96932c9c38863a53a26 Mon Sep 17 00:00:00 2001 From: Rashmi Pujar Date: Sat, 22 Jan 2022 00:37:28 -0500 Subject: Add TOSCA policy status header field to APEX event create CLI In order to expose the processing status of a TOSCA policy to APEX-PDP, a new header field for APEX concept "event" has been introduced to track this within an APEX policy implementation. This field will be leveraged to extract the TOSCA policy execution metrics. Note, that the field is marked as optional for backward compatibility. Unit tests have been augmented to test for the field wherever applicable and the default empty value is retained for the others. "example-grpc" module has been updated to include this field. Exposing the TOSCA policy execution metrics is outside the scope of this patch since the current changes are already very large owing to the atomic nature of the change introduced. Issue-ID: POLICY-3845 Signed-off-by: Rashmi Pujar Change-Id: Ief6d70f9abcfc8414e10aa51a27815ee9028e4c8 --- .../java/org/onap/policy/apex/core/engine/event/EnEventTest.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'core/core-engine') diff --git a/core/core-engine/src/test/java/org/onap/policy/apex/core/engine/event/EnEventTest.java b/core/core-engine/src/test/java/org/onap/policy/apex/core/engine/event/EnEventTest.java index 128e585fe..49b4f80d2 100644 --- a/core/core-engine/src/test/java/org/onap/policy/apex/core/engine/event/EnEventTest.java +++ b/core/core-engine/src/test/java/org/onap/policy/apex/core/engine/event/EnEventTest.java @@ -2,6 +2,7 @@ * ============LICENSE_START======================================================= * Copyright (C) 2018 Ericsson. All rights reserved. * Modifications Copyright (C) 2020-2021 Nordix Foundation + * Modifications Copyright (C) 2022 Bell Canada. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -95,7 +96,7 @@ public class EnEventTest { event.setUserArtifactStack(usedArtifactStackArray); assertEquals(usedArtifactStackArray.length, event.getUserArtifactStack().length); assertEquals("EnEvent [axEvent=AxEvent:(key=AxArtifactKey:(name=Event,version=0.0.1),nameSpace=a.name.space," - + "source=some source,target=some target,parameter={}), " + + "source=some source,target=some target,parameter={},toscaPolicyState=), " + "userArtifactStack=[AxArtifactKey:(name=Event,version=0.0.1)], map={}]", event.toString()); assertThatThrownBy(() -> event.put(null, null)) .hasMessage("null keys are illegal on method parameter \"key\""); @@ -166,4 +167,4 @@ public class EnEventTest { EnEvent otherEvent = new EnEvent(eventKey); assertEquals(event, otherEvent); } -} +} \ No newline at end of file -- cgit 1.2.3-korg