summaryrefslogtreecommitdiffstats
path: root/auth/cli-codegen/src/test
diff options
context:
space:
mode:
authora.sreekumar <ajith.sreekumar@bell.ca>2021-06-29 13:57:14 +0100
committera.sreekumar <ajith.sreekumar@bell.ca>2021-07-02 16:03:51 +0100
commit5f0ec1c2d95c377fbec428f11464e93fe442b5ef (patch)
tree4aef07097fa4d64550db116a1b1b4acd1aa42590 /auth/cli-codegen/src/test
parentba55109db1e5eea013dcffd1be29cf06fe2bbcb1 (diff)
Cleanup input & outputFields from Task definition
1) Remove the usage of inputField and outputField from Task definition. 2) Fix issues around populating events to task in case of State Finalizer Logic. Change-Id: Ief17f400729410b83c6b7c665980d443e0cf6f28 Issue-ID: POLICY-3336 Signed-off-by: a.sreekumar <ajith.sreekumar@bell.ca>
Diffstat (limited to 'auth/cli-codegen/src/test')
-rw-r--r--auth/cli-codegen/src/test/java/org/onap/policy/apex/auth/clicodegen/CodeGeneratorCliEditorTest.java52
1 files changed, 3 insertions, 49 deletions
diff --git a/auth/cli-codegen/src/test/java/org/onap/policy/apex/auth/clicodegen/CodeGeneratorCliEditorTest.java b/auth/cli-codegen/src/test/java/org/onap/policy/apex/auth/clicodegen/CodeGeneratorCliEditorTest.java
index cec261c2a..d6cf1686b 100644
--- a/auth/cli-codegen/src/test/java/org/onap/policy/apex/auth/clicodegen/CodeGeneratorCliEditorTest.java
+++ b/auth/cli-codegen/src/test/java/org/onap/policy/apex/auth/clicodegen/CodeGeneratorCliEditorTest.java
@@ -107,17 +107,13 @@ public class CodeGeneratorCliEditorTest {
// 2: tasks
for (final AxTask t : policyModel.getTasks().getTaskMap().values()) {
final AxArtifactKey key = t.getKey();
- final List<ST> infields = getInfieldsForTask(codeGen, t);
- final List<ST> outfields = getOutfieldsForTask(codeGen, t);
final ST logic = getLogicForTask(codeGen, t);
final List<ST> parameters = getParametersForTask(codeGen, t);
final List<ST> contextRefs = getCtxtRefsForTask(codeGen, t);
- codeGen.addTaskDeclaration(
- new TaskDeclarationBuilder().setName(kig.getName(key)).setVersion(kig.getVersion(key))
- .setUuid(kig.getUuid(key)).setDescription(kig.getDesc(key)).setInfields(infields)
- .setOutfields(outfields).setLogic(logic).setParameters(parameters)
- .setContextRefs(contextRefs));
+ codeGen.addTaskDeclaration(new TaskDeclarationBuilder().setName(kig.getName(key))
+ .setVersion(kig.getVersion(key)).setUuid(kig.getUuid(key)).setDescription(kig.getDesc(key))
+ .setLogic(logic).setParameters(parameters).setContextRefs(contextRefs));
}
// 3: events
@@ -248,48 +244,6 @@ public class CodeGeneratorCliEditorTest {
}
/**
- * Gets the output fields for task.
- *
- * @param cg the code generator
- * @param task the task
- * @return the output fields for task
- */
- private List<ST> getOutfieldsForTask(final CodeGeneratorCliEditor cg, final AxTask task) {
- final Collection<? extends AxField> fields = task.getOutputFields().values();
- final List<ST> ret = new ArrayList<>(fields.size());
- for (final AxField f : fields) {
- final AxReferenceKey fkey = f.getKey();
-
- final ST val = cg.createTaskDefinitionOutfields(kig.getPName(fkey), kig.getPVersion(fkey),
- kig.getLName(fkey), kig.getName(f.getSchema()), kig.getVersion(f.getSchema()));
-
- ret.add(val);
- }
- return ret;
- }
-
- /**
- * Gets the input fields for task.
- *
- * @param cg the code generator
- * @param task the task
- * @return the input fields for task
- */
- private List<ST> getInfieldsForTask(final CodeGeneratorCliEditor cg, final AxTask task) {
- final Collection<? extends AxField> fields = task.getInputFields().values();
- final List<ST> ret = new ArrayList<>(fields.size());
- for (final AxField f : fields) {
- final AxReferenceKey fkey = f.getKey();
-
- final ST val = cg.createTaskDefinitionInfields(kig.getPName(fkey), kig.getPVersion(fkey),
- kig.getLName(fkey), kig.getName(f.getSchema()), kig.getVersion(f.getSchema()));
-
- ret.add(val);
- }
- return ret;
- }
-
- /**
* Gets the states for policy.
*
* @param cg the code generator