aboutsummaryrefslogtreecommitdiffstats
path: root/core/core-engine/src/test
diff options
context:
space:
mode:
authorliamfallon <liam.fallon@est.tech>2019-06-26 15:40:41 +0000
committerliamfallon <liam.fallon@est.tech>2019-06-26 15:40:41 +0000
commitce9d82d2c0e863597d84cc8909955e398405f45a (patch)
tree8ebb853119bdf673cf6f9516d428d4cc00080aeb /core/core-engine/src/test
parent5f029543f1e673655af2d2974113069df0b6def0 (diff)
Add passthrough properties for APEX engine
APEX event receiver and sender plugins sometimes need to exchange information with tasks, especially in the case of REST communication. This change enables passthrough of Properties from the event carrier technology plugins to APEX task, task selection, and state finalizer logics. Apologies for the size of the review but this change involves passinng the properties through all the APEX components, hence the large number of small changes. Issue-ID: POLICY-1742 Change-Id: I219fd69550f06702ef64adbb165fe7baac422e96 Signed-off-by: liamfallon <liam.fallon@est.tech>
Diffstat (limited to 'core/core-engine/src/test')
-rw-r--r--core/core-engine/src/test/java/org/onap/policy/apex/core/engine/engine/impl/DummySmExecutor.java32
-rw-r--r--core/core-engine/src/test/java/org/onap/policy/apex/core/engine/executor/DummyStateFinalizerExecutor.java30
-rw-r--r--core/core-engine/src/test/java/org/onap/policy/apex/core/engine/executor/DummyTaskExecutor.java39
-rw-r--r--core/core-engine/src/test/java/org/onap/policy/apex/core/engine/executor/DummyTaskSelectExecutor.java31
-rw-r--r--core/core-engine/src/test/java/org/onap/policy/apex/core/engine/executor/StateExecutorTest.java10
-rw-r--r--core/core-engine/src/test/java/org/onap/policy/apex/core/engine/executor/StateFinalizerExecutorTest.java22
-rw-r--r--core/core-engine/src/test/java/org/onap/policy/apex/core/engine/executor/StateMachineExecutorTest.java32
-rw-r--r--core/core-engine/src/test/java/org/onap/policy/apex/core/engine/executor/TaskExecutorTest.java12
-rw-r--r--core/core-engine/src/test/java/org/onap/policy/apex/core/engine/executor/TaskSelectExecutorTest.java24
-rw-r--r--core/core-engine/src/test/java/org/onap/policy/apex/core/engine/executor/context/StateFinalizerExecutionContextTest.java8
-rw-r--r--core/core-engine/src/test/java/org/onap/policy/apex/core/engine/executor/context/TaskExecutionContextTest.java8
11 files changed, 117 insertions, 131 deletions
diff --git a/core/core-engine/src/test/java/org/onap/policy/apex/core/engine/engine/impl/DummySmExecutor.java b/core/core-engine/src/test/java/org/onap/policy/apex/core/engine/engine/impl/DummySmExecutor.java
index db8fc32d9..b95e959f0 100644
--- a/core/core-engine/src/test/java/org/onap/policy/apex/core/engine/engine/impl/DummySmExecutor.java
+++ b/core/core-engine/src/test/java/org/onap/policy/apex/core/engine/engine/impl/DummySmExecutor.java
@@ -5,21 +5,23 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- *
+ *
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
package org.onap.policy.apex.core.engine.engine.impl;
+import java.util.Properties;
+
import org.onap.policy.apex.core.engine.event.EnEvent;
import org.onap.policy.apex.core.engine.executor.ExecutorFactory;
import org.onap.policy.apex.core.engine.executor.StateMachineExecutor;
@@ -32,10 +34,10 @@ import org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey;
public class DummySmExecutor extends StateMachineExecutor {
private boolean cleanupWorks = false;
private boolean prepareWorks;
-
+
/**
* Constructor.
- *
+ *
* @param executorFactory the factory for executors
* @param owner the owner key
*/
@@ -43,10 +45,8 @@ public class DummySmExecutor extends StateMachineExecutor {
super(executorFactory, owner);
}
- /*
- * (non-Javadoc)
- *
- * @see org.onap.policy.apex.core.engine.executor.Executor#prepare()
+ /**
+ * {@inheritDoc}
*/
@Override
public void prepare() throws StateMachineException {
@@ -59,20 +59,16 @@ public class DummySmExecutor extends StateMachineExecutor {
}
}
- /*
- * (non-Javadoc)
- *
- * @see org.onap.policy.apex.core.engine.executor.Executor#executeDirected(java.lang.long, java.lang.Object)
+ /**
+ * {@inheritDoc}
*/
@Override
- public EnEvent execute(final long executionId, final EnEvent incomingEvent) {
+ public EnEvent execute(final long executionId, final Properties executionProperties, final EnEvent incomingEvent) {
return incomingEvent;
}
- /*
- * (non-Javadoc)
- *
- * @see org.onap.policy.apex.core.engine.executor.Executor#cleanUp()
+ /**
+ * {@inheritDoc}
*/
@Override
public void cleanUp() throws StateMachineException {
diff --git a/core/core-engine/src/test/java/org/onap/policy/apex/core/engine/executor/DummyStateFinalizerExecutor.java b/core/core-engine/src/test/java/org/onap/policy/apex/core/engine/executor/DummyStateFinalizerExecutor.java
index abc11871e..b4fefc2d9 100644
--- a/core/core-engine/src/test/java/org/onap/policy/apex/core/engine/executor/DummyStateFinalizerExecutor.java
+++ b/core/core-engine/src/test/java/org/onap/policy/apex/core/engine/executor/DummyStateFinalizerExecutor.java
@@ -5,15 +5,15 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- *
+ *
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
@@ -21,6 +21,7 @@
package org.onap.policy.apex.core.engine.executor;
import java.util.Map;
+import java.util.Properties;
import org.onap.policy.apex.context.ContextException;
import org.onap.policy.apex.core.engine.executor.exception.StateMachineException;
@@ -30,34 +31,31 @@ import org.onap.policy.apex.core.engine.executor.exception.StateMachineException
*/
public class DummyStateFinalizerExecutor extends StateFinalizerExecutor {
private boolean override;
-
+
private boolean returnBad;
public DummyStateFinalizerExecutor() {
this(false);
}
-
+
public DummyStateFinalizerExecutor(final boolean override) {
this.override = override;
}
- /*
- * (non-Javadoc)
- *
- * @see org.onap.policy.apex.core.engine.executor.Executor#execute(java.lang.long, java.lang.Object)
+ /**
+ * {@inheritDoc}
*/
@Override
- public String execute(final long executionId, final Map<String, Object> newIncomingFields)
- throws StateMachineException, ContextException {
-
+ public String execute(final long executionId, final Properties executionProperties,
+ final Map<String, Object> newIncomingFields) throws StateMachineException, ContextException {
+
if (!override) {
- super.execute(executionId, newIncomingFields);
+ super.execute(executionId, executionProperties, newIncomingFields);
}
-
+
if (returnBad) {
return "stateOutputBad";
- }
- else {
+ } else {
return "stateOutput1";
}
}
diff --git a/core/core-engine/src/test/java/org/onap/policy/apex/core/engine/executor/DummyTaskExecutor.java b/core/core-engine/src/test/java/org/onap/policy/apex/core/engine/executor/DummyTaskExecutor.java
index 93fc6190f..fcfc85f66 100644
--- a/core/core-engine/src/test/java/org/onap/policy/apex/core/engine/executor/DummyTaskExecutor.java
+++ b/core/core-engine/src/test/java/org/onap/policy/apex/core/engine/executor/DummyTaskExecutor.java
@@ -5,15 +5,15 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- *
+ *
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
@@ -21,6 +21,7 @@
package org.onap.policy.apex.core.engine.executor;
import java.util.Map;
+import java.util.Properties;
import org.onap.policy.apex.context.ContextException;
import org.onap.policy.apex.core.engine.event.EnEvent;
@@ -48,42 +49,36 @@ public class DummyTaskExecutor extends TaskExecutor {
super.prepare();
}
}
-
- /*
- * (non-Javadoc)
- *
- * @see org.onap.policy.apex.core.engine.executor.Executor#execute(java.lang.long, java.lang.Object)
+
+ /**
+ * {@inheritDoc}
*/
@Override
- public Map<String, Object> execute(final long executionId, final Map<String, Object> newIncomingFields)
- throws StateMachineException, ContextException {
+ public Map<String, Object> execute(final long executionId, final Properties executionProperties,
+ final Map<String, Object> newIncomingFields) throws StateMachineException, ContextException {
if (!override) {
- super.execute(executionId, newIncomingFields);
+ super.execute(executionId, executionProperties, newIncomingFields);
}
-
+
AxArtifactKey event0Key = new AxArtifactKey("Event0:0.0.1");
return new EnEvent(event0Key);
}
-
- /*
- * (non-Javadoc)
- *
- * @see org.onap.policy.apex.core.engine.executor.Executor#getSubject()
+
+ /**
+ * {@inheritDoc}
*/
@Override
public AxTask getSubject() {
if (!override) {
super.getSubject();
}
-
+
AxArtifactKey taskKey = new AxArtifactKey("FirstTask:0.0.1");
return new AxTask(taskKey);
}
- /*
- * (non-Javadoc)
- *
- * @see org.onap.policy.apex.core.engine.executor.Executor#cleanUp()
+ /**
+ * {@inheritDoc}
*/
@Override
public void cleanUp() throws StateMachineException {
diff --git a/core/core-engine/src/test/java/org/onap/policy/apex/core/engine/executor/DummyTaskSelectExecutor.java b/core/core-engine/src/test/java/org/onap/policy/apex/core/engine/executor/DummyTaskSelectExecutor.java
index abbb1bd79..03d0b2894 100644
--- a/core/core-engine/src/test/java/org/onap/policy/apex/core/engine/executor/DummyTaskSelectExecutor.java
+++ b/core/core-engine/src/test/java/org/onap/policy/apex/core/engine/executor/DummyTaskSelectExecutor.java
@@ -5,21 +5,23 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- *
+ *
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
package org.onap.policy.apex.core.engine.executor;
+import java.util.Properties;
+
import org.onap.policy.apex.context.ContextException;
import org.onap.policy.apex.core.engine.event.EnEvent;
import org.onap.policy.apex.core.engine.executor.exception.StateMachineException;
@@ -32,7 +34,7 @@ public class DummyTaskSelectExecutor extends TaskSelectExecutor {
private boolean override;
private static int taskNo;
-
+
public DummyTaskSelectExecutor() {
this(false);
}
@@ -48,30 +50,25 @@ public class DummyTaskSelectExecutor extends TaskSelectExecutor {
}
}
- /*
- * (non-Javadoc)
- *
- * @see org.onap.policy.apex.core.engine.executor.Executor#execute(java.lang.long, java.lang.Object)
+ /**
+ * {@inheritDoc}
*/
@Override
- public AxArtifactKey execute(final long executionId, final EnEvent newIncomingEvent)
- throws StateMachineException, ContextException {
+ public AxArtifactKey execute(final long executionId, final Properties executionProperties,
+ final EnEvent newIncomingEvent) throws StateMachineException, ContextException {
if (!override) {
- return super.execute(executionId, newIncomingEvent);
+ return super.execute(executionId, executionProperties, newIncomingEvent);
}
-
+
return new AxArtifactKey("task" + (taskNo++) + ":0.0.1");
}
public void setTaskNo(int incomingTaskNo) {
taskNo = incomingTaskNo;
}
-
- /*
- * (non-Javadoc)
- *
- * @see org.onap.policy.apex.core.engine.executor.Executor#cleanUp()
+ /**
+ * {@inheritDoc}
*/
@Override
public void cleanUp() throws StateMachineException {
diff --git a/core/core-engine/src/test/java/org/onap/policy/apex/core/engine/executor/StateExecutorTest.java b/core/core-engine/src/test/java/org/onap/policy/apex/core/engine/executor/StateExecutorTest.java
index 08ab03b06..ed5f9135c 100644
--- a/core/core-engine/src/test/java/org/onap/policy/apex/core/engine/executor/StateExecutorTest.java
+++ b/core/core-engine/src/test/java/org/onap/policy/apex/core/engine/executor/StateExecutorTest.java
@@ -5,15 +5,15 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- *
+ *
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
@@ -56,7 +56,7 @@ public class StateExecutorTest {
@Before
public void startMocking() {
MockitoAnnotations.initMocks(this);
-
+
Mockito.doReturn(new AxReferenceKey("Policy:0.0.1:PolName:State0")).when(axStateMock).getKey();
}
@@ -80,7 +80,7 @@ public class StateExecutorTest {
assertEquals(null, executor.getNext());
try {
- executor.executePre(0, null);
+ executor.executePre(0, null, null);
fail("test should throw an exception");
} catch (Exception ex) {
assertEquals("execution pre work not implemented on class", ex.getMessage());
diff --git a/core/core-engine/src/test/java/org/onap/policy/apex/core/engine/executor/StateFinalizerExecutorTest.java b/core/core-engine/src/test/java/org/onap/policy/apex/core/engine/executor/StateFinalizerExecutorTest.java
index 82ac610c9..a94fe9e80 100644
--- a/core/core-engine/src/test/java/org/onap/policy/apex/core/engine/executor/StateFinalizerExecutorTest.java
+++ b/core/core-engine/src/test/java/org/onap/policy/apex/core/engine/executor/StateFinalizerExecutorTest.java
@@ -5,15 +5,15 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- *
+ *
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
@@ -63,10 +63,10 @@ public class StateFinalizerExecutorTest {
@Before
public void startMocking() {
MockitoAnnotations.initMocks(this);
-
+
AxState state = new AxState();
state.getStateOutputs().put("ValidOutput", null);
-
+
Mockito.doReturn(state).when(parentMock).getSubject();
Mockito.doReturn(new AxReferenceKey("State:0.0.1:StateName:StateSFL")).when(stateFinalizerLogicMock).getKey();
@@ -117,19 +117,19 @@ public class StateFinalizerExecutorTest {
}
try {
- executor.executePre(0, incomingEvent);
+ executor.executePre(0, null, incomingEvent);
} catch (Exception ex) {
assertEquals("task input fields \"[InField0]\" are missing for task \"Task0:0.0.1\"", ex.getMessage());
}
try {
- executor.executePre(0, incomingEvent);
+ executor.executePre(0, null, incomingEvent);
} catch (Exception e) {
fail("test should not throw an exception");
}
try {
- executor.execute(0, incomingEvent);
+ executor.execute(0, null, incomingEvent);
fail("test should throw an exception");
} catch (Exception ex) {
assertEquals("execute() not implemented on abstract StateFinalizerExecutionContext class, "
@@ -154,7 +154,7 @@ public class StateFinalizerExecutorTest {
}
try {
- executor.executePre(0, incomingEvent);
+ executor.executePre(0, null, incomingEvent);
} catch (Exception ex) {
fail("test should not throw an exception");
}
@@ -168,7 +168,7 @@ public class StateFinalizerExecutorTest {
}
try {
- executor.executePre(0, incomingEvent);
+ executor.executePre(0, null, incomingEvent);
} catch (Exception ex) {
fail("test should not throw an exception");
}
@@ -184,7 +184,7 @@ public class StateFinalizerExecutorTest {
}
try {
- executor.executePre(0, incomingEvent);
+ executor.executePre(0, null, incomingEvent);
} catch (Exception ex) {
fail("test should not throw an exception");
}
diff --git a/core/core-engine/src/test/java/org/onap/policy/apex/core/engine/executor/StateMachineExecutorTest.java b/core/core-engine/src/test/java/org/onap/policy/apex/core/engine/executor/StateMachineExecutorTest.java
index f9d3edc6c..c2abd1e96 100644
--- a/core/core-engine/src/test/java/org/onap/policy/apex/core/engine/executor/StateMachineExecutorTest.java
+++ b/core/core-engine/src/test/java/org/onap/policy/apex/core/engine/executor/StateMachineExecutorTest.java
@@ -5,15 +5,15 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- *
+ *
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
@@ -187,7 +187,7 @@ public class StateMachineExecutorTest {
new AxArtifactKey("OwnerKey:0.0.1"));
try {
- executor.execute(0, incomingEventMock);
+ executor.execute(0, null, incomingEventMock);
fail("test should throw an exception");
} catch (Exception ex) {
assertEquals("no states defined on state machine", ex.getMessage());
@@ -209,7 +209,7 @@ public class StateMachineExecutorTest {
assertEquals(null, executor.getNext());
try {
- executor.executePre(0, null);
+ executor.executePre(0, null, null);
fail("test should throw an exception");
} catch (Exception ex) {
assertEquals("execution pre work not implemented on class", ex.getMessage());
@@ -231,7 +231,7 @@ public class StateMachineExecutorTest {
axPolicy.setFirstState("BadState");
executor.setContext(null, axPolicy, internalContextMock);
try {
- executor.execute(0, incomingEventMock);
+ executor.execute(0, null, incomingEventMock);
fail("test should throw an exception");
} catch (Exception ex) {
assertEquals("first state not defined on state machine", ex.getMessage());
@@ -240,14 +240,14 @@ public class StateMachineExecutorTest {
axPolicy.setFirstState("state0");
executor.setContext(null, axPolicy, internalContextMock);
try {
- executor.execute(0, incomingEventMock);
+ executor.execute(0, null, incomingEventMock);
} catch (Exception ex) {
fail("test should not throw an exception");
}
dummyTsle.setTaskNo(0);
try {
- executor.execute(0, incomingEventMock);
+ executor.execute(0, null, incomingEventMock);
} catch (Exception ex) {
fail("test should not throw an exception");
}
@@ -256,7 +256,7 @@ public class StateMachineExecutorTest {
axPolicy.getStateMap().get("State1").getStateOutputs().get("stateOutput1").setNextState(badStateKey);
dummyTsle.setTaskNo(0);
try {
- executor.execute(0, incomingEventMock);
+ executor.execute(0, null, incomingEventMock);
fail("test should throw an exception");
} catch (Exception ex) {
assertEquals("state execution failed, next state \"Policy:0.0.1:PName:BadState\" not found",
@@ -267,7 +267,7 @@ public class StateMachineExecutorTest {
.setNextState(AxReferenceKey.getNullKey());
dummyTsle.setTaskNo(0);
try {
- executor.execute(0, incomingEventMock);
+ executor.execute(0, null, incomingEventMock);
} catch (Exception ex) {
fail("test should not throw an exception");
}
@@ -275,7 +275,7 @@ public class StateMachineExecutorTest {
axPolicy.getStateMap().get("State1").setTrigger(new AxArtifactKey("BadTrigger:0.0.1"));
dummyTsle.setTaskNo(0);
try {
- executor.execute(0, incomingEventMock);
+ executor.execute(0, null, incomingEventMock);
fail("test should throw an exception");
} catch (Exception ex) {
assertEquals("incoming event \"Event1:0.0.1\" does not match trigger \"BadTrigger:0.0.1\" "
@@ -285,7 +285,7 @@ public class StateMachineExecutorTest {
axPolicy.getStateMap().get("State1").setTrigger(new AxArtifactKey("Event1:0.0.1"));
dummyTsle.setTaskNo(0);
try {
- executor.execute(0, incomingEventMock);
+ executor.execute(0, null, incomingEventMock);
} catch (Exception ex) {
fail("test should not throw an exception");
}
@@ -309,7 +309,7 @@ public class StateMachineExecutorTest {
dummyTsle.setTaskNo(0);
try {
- executor.execute(0, incomingEventMock);
+ executor.execute(0, null, incomingEventMock);
} catch (Exception ex) {
fail("test should not throw an exception");
}
@@ -334,7 +334,7 @@ public class StateMachineExecutorTest {
dummyTsle.setTaskNo(0);
try {
- executor.execute(0, incomingEventMock);
+ executor.execute(0, null, incomingEventMock);
} catch (Exception ex) {
fail("test should not throw an exception");
}
@@ -342,7 +342,7 @@ public class StateMachineExecutorTest {
dummyTsle.setTaskNo(0);
dummySfle.setReturnBad(true);
try {
- executor.execute(0, incomingEventMock);
+ executor.execute(0, null, incomingEventMock);
fail("test should throw an exception");
} catch (Exception ex) {
assertEquals("State execution of state \"Policy:0.0.1:NULL:state1\" on task \"task1:0.0.1\" failed: "
@@ -353,7 +353,7 @@ public class StateMachineExecutorTest {
dummyTsle.setTaskNo(0);
dummySfle.setReturnBad(false);
try {
- executor.execute(0, incomingEventMock);
+ executor.execute(0, null, incomingEventMock);
} catch (Exception ex) {
fail("test should not throw an exception");
}
diff --git a/core/core-engine/src/test/java/org/onap/policy/apex/core/engine/executor/TaskExecutorTest.java b/core/core-engine/src/test/java/org/onap/policy/apex/core/engine/executor/TaskExecutorTest.java
index bfc8e2b6d..a4a0f21ec 100644
--- a/core/core-engine/src/test/java/org/onap/policy/apex/core/engine/executor/TaskExecutorTest.java
+++ b/core/core-engine/src/test/java/org/onap/policy/apex/core/engine/executor/TaskExecutorTest.java
@@ -5,15 +5,15 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- *
+ *
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
@@ -158,20 +158,20 @@ public class TaskExecutorTest {
Map<String, Object> incomingFields = new LinkedHashMap<>();
try {
- executor.executePre(0, incomingFields);
+ executor.executePre(0, null, incomingFields);
} catch (Exception ex) {
assertEquals("task input fields \"[InField0]\" are missing for task \"Task0:0.0.1\"", ex.getMessage());
}
incomingFields.put("InField0", "A Value");
try {
- executor.executePre(0, incomingFields);
+ executor.executePre(0, null, incomingFields);
} catch (Exception e) {
fail("test should not throw an exception");
}
try {
- executor.execute(0, incomingFields);
+ executor.execute(0, null, incomingFields);
fail("test should throw an exception");
} catch (Exception ex) {
assertEquals("execute() not implemented on abstract TaskExecutor class, only on its subclasses",
diff --git a/core/core-engine/src/test/java/org/onap/policy/apex/core/engine/executor/TaskSelectExecutorTest.java b/core/core-engine/src/test/java/org/onap/policy/apex/core/engine/executor/TaskSelectExecutorTest.java
index b303df06a..2ee308977 100644
--- a/core/core-engine/src/test/java/org/onap/policy/apex/core/engine/executor/TaskSelectExecutorTest.java
+++ b/core/core-engine/src/test/java/org/onap/policy/apex/core/engine/executor/TaskSelectExecutorTest.java
@@ -5,15 +5,15 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- *
+ *
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
@@ -70,7 +70,7 @@ public class TaskSelectExecutorTest {
AxReferenceKey state0Key = new AxReferenceKey("State0Parent:0.0.1:Parent:State0");
Mockito.doReturn(state0Key).when(axStateMock).getKey();
Mockito.doReturn(state0Key.getId()).when(axStateMock).getId();
-
+
Map<AxArtifactKey, AxStateTaskReference> taskReferences = new LinkedHashMap<>();
taskReferences.put(new AxArtifactKey("Task0:0.0.0"), null);
taskReferences.put(new AxArtifactKey("Task1:0.0.0"), null);
@@ -127,19 +127,19 @@ public class TaskSelectExecutorTest {
}
try {
- executor.executePre(0, incomingEvent);
+ executor.executePre(0, null, incomingEvent);
} catch (Exception ex) {
assertEquals("task input fields \"[InField0]\" are missing for task \"Task0:0.0.1\"", ex.getMessage());
}
try {
- executor.executePre(0, incomingEvent);
+ executor.executePre(0, null, incomingEvent);
} catch (Exception e) {
fail("test should not throw an exception");
}
try {
- executor.execute(0, incomingEvent);
+ executor.execute(0, null, incomingEvent);
fail("test should throw an exception");
} catch (Exception ex) {
assertEquals("execute() not implemented on class", ex.getMessage());
@@ -163,7 +163,7 @@ public class TaskSelectExecutorTest {
}
try {
- executor.executePre(0, incomingEvent);
+ executor.executePre(0, null, incomingEvent);
} catch (Exception e) {
fail("test should not throw an exception");
}
@@ -176,7 +176,7 @@ public class TaskSelectExecutorTest {
}
try {
- executor.executePre(0, incomingEvent);
+ executor.executePre(0, null, incomingEvent);
} catch (Exception e) {
fail("test should not throw an exception");
}
@@ -189,15 +189,15 @@ public class TaskSelectExecutorTest {
assertEquals("task \"IDontExist:0.0.0\" returned by task selection logic not defined "
+ "on state \"State0Parent:0.0.1:Parent:State0\"", ex.getMessage());
}
-
+
try {
- executor.executePre(0, incomingEvent);
+ executor.executePre(0, null, incomingEvent);
} catch (Exception e) {
fail("test should not throw an exception");
}
executor.getOutgoing().setName("Task0");
-
+
try {
executor.executePost(true);
assertEquals("Task0", executor.getOutgoing().getName());
diff --git a/core/core-engine/src/test/java/org/onap/policy/apex/core/engine/executor/context/StateFinalizerExecutionContextTest.java b/core/core-engine/src/test/java/org/onap/policy/apex/core/engine/executor/context/StateFinalizerExecutionContextTest.java
index 8b0710ec7..fe437b823 100644
--- a/core/core-engine/src/test/java/org/onap/policy/apex/core/engine/executor/context/StateFinalizerExecutionContextTest.java
+++ b/core/core-engine/src/test/java/org/onap/policy/apex/core/engine/executor/context/StateFinalizerExecutionContextTest.java
@@ -5,15 +5,15 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- *
+ *
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
@@ -89,7 +89,7 @@ public class StateFinalizerExecutionContextTest {
final Map<String, Object> fields = new LinkedHashMap<>();
final Set<String> stateOutputNames = new LinkedHashSet<>();
- StateFinalizerExecutionContext sfec = new StateFinalizerExecutionContext(stateFinalizerExecutorMock, 0,
+ StateFinalizerExecutionContext sfec = new StateFinalizerExecutionContext(stateFinalizerExecutorMock, 0, null,
axStateMock, fields, stateOutputNames, internalContextMock);
assertNotNull(sfec);
diff --git a/core/core-engine/src/test/java/org/onap/policy/apex/core/engine/executor/context/TaskExecutionContextTest.java b/core/core-engine/src/test/java/org/onap/policy/apex/core/engine/executor/context/TaskExecutionContextTest.java
index c6c196a01..29c536ed4 100644
--- a/core/core-engine/src/test/java/org/onap/policy/apex/core/engine/executor/context/TaskExecutionContextTest.java
+++ b/core/core-engine/src/test/java/org/onap/policy/apex/core/engine/executor/context/TaskExecutionContextTest.java
@@ -5,15 +5,15 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- *
+ *
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
@@ -87,7 +87,7 @@ public class TaskExecutionContextTest {
final Map<String, Object> inFields = new LinkedHashMap<>();
final Map<String, Object> outFields = new LinkedHashMap<>();
- TaskExecutionContext tec = new TaskExecutionContext(taskExecutorMock, 0, axTaskMock, inFields, outFields,
+ TaskExecutionContext tec = new TaskExecutionContext(taskExecutorMock, 0, null, axTaskMock, inFields, outFields,
internalContextMock);
assertNotNull(tec);