summaryrefslogtreecommitdiffstats
path: root/auth/cli-codegen/src/test/java
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2021-08-23 17:10:00 -0400
committerJim Hahn <jrh3@att.com>2021-08-24 09:22:38 -0400
commit53fe02c107eae2f45abfee02e5b56a8ab3c09523 (patch)
tree35c9646b7c629485f6241ed1b48b853305e585ac /auth/cli-codegen/src/test/java
parentc3d0b33c9facf49e37e9ab58412227ff44c66363 (diff)
More lombok for apex-pdp
Added lombok to auth thru context-management, excluding basic-model and context-model. Issue-ID: POLICY-3391 Change-Id: I1c3a69d52d3bc65a99126ad44126e5a97424c66f Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'auth/cli-codegen/src/test/java')
-rw-r--r--auth/cli-codegen/src/test/java/org/onap/policy/apex/auth/clicodegen/CodeGeneratorCliEditorTest.java74
1 files changed, 39 insertions, 35 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 d6cf1686b..8ad8b0213 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
@@ -4,6 +4,7 @@
* Modifications Copyright (C) 2019 Samsung Electronics Co., Ltd.
* Modifications Copyright (C) 2020 Nordix Foundation
* Modifications Copyright (C) 2021 Bell Canada. All rights reserved.
+ * Modifications Copyright (C) 2021 AT&T Intellectual Property. 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.
@@ -111,9 +112,9 @@ public class CodeGeneratorCliEditorTest {
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))
- .setLogic(logic).setParameters(parameters).setContextRefs(contextRefs));
+ codeGen.addTaskDeclaration(TaskDeclaration.builder().name(kig.getName(key))
+ .version(kig.getVersion(key)).uuid(kig.getUuid(key)).description(kig.getDesc(key))
+ .logic(logic).parameters(parameters).contextRefs(contextRefs).build());
}
// 3: events
@@ -122,15 +123,16 @@ public class CodeGeneratorCliEditorTest {
final List<ST> fields = getParametersForEvent(codeGen, e);
codeGen.addEventDeclaration(
- new EventDeclarationBuilder()
- .setName(kig.getName(key))
- .setVersion(kig.getVersion(key))
- .setUuid(kig.getUuid(key))
- .setDescription(kig.getDesc(key))
- .setNameSpace(e.getNameSpace())
- .setSource(e.getSource())
- .setTarget(e.getTarget())
- .setFields(fields));
+ EventDeclaration.builder()
+ .name(kig.getName(key))
+ .version(kig.getVersion(key))
+ .uuid(kig.getUuid(key))
+ .description(kig.getDesc(key))
+ .nameSpace(e.getNameSpace())
+ .source(e.getSource())
+ .target(e.getTarget())
+ .fields(fields)
+ .build());
}
// 4: context albums
@@ -138,15 +140,16 @@ public class CodeGeneratorCliEditorTest {
final AxArtifactKey key = a.getKey();
codeGen.addContextAlbumDeclaration(
- new CodeGenCliEditorBuilder()
- .setName(kig.getName(key))
- .setVersion(kig.getVersion(key))
- .setUuid(kig.getUuid(key))
- .setDescription(kig.getDesc(key))
- .setScope(a.getScope())
- .setWritable(a.isWritable())
- .setSchemaName(kig.getName(a.getItemSchema()))
- .setSchemaVersion(kig.getVersion(a.getItemSchema())));
+ CodeGenCliEditor.builder()
+ .name(kig.getName(key))
+ .version(kig.getVersion(key))
+ .uuid(kig.getUuid(key))
+ .description(kig.getDesc(key))
+ .scope(a.getScope())
+ .writable(a.isWritable())
+ .schemaName(kig.getName(a.getItemSchema()))
+ .schemaVersion(kig.getVersion(a.getItemSchema()))
+ .build());
}
// 5: policies
@@ -261,14 +264,14 @@ public class CodeGeneratorCliEditorTest {
final List<ST> tsLogic = getTslForState(cg, st);
final List<ST> ctxRefs = getCtxtRefsForState(cg, st);
- final ST val = cg.createPolicyStateDef(new PolicyStateDefBuilder()
- .setPolicyName(kig.getPName(skey)).setVersion(kig.getPVersion(skey))
- .setStateName(kig.getLName(skey)).setTriggerName(kig.getName(st.getTrigger()))
- .setTriggerVersion(kig.getVersion(st.getTrigger()))
- .setDefaultTask(kig.getName(st.getDefaultTask()))
- .setDefaultTaskVersion(kig.getVersion(st.getDefaultTask())).setOutputs(outputs)
- .setTasks(tasks).setTsLogic(tsLogic).setFinalizerLogics(finalizerLogics)
- .setCtxRefs(ctxRefs));
+ final ST val = cg.createPolicyStateDef(PolicyStateDef.builder()
+ .policyName(kig.getPName(skey)).version(kig.getPVersion(skey))
+ .stateName(kig.getLName(skey)).triggerName(kig.getName(st.getTrigger()))
+ .triggerVersion(kig.getVersion(st.getTrigger()))
+ .defaultTask(kig.getName(st.getDefaultTask()))
+ .defaultTaskVersion(kig.getVersion(st.getDefaultTask())).outputs(outputs)
+ .tasks(tasks).tsLogic(tsLogic).finalizerLogics(finalizerLogics)
+ .ctxRefs(ctxRefs).build());
ret.add(val);
}
@@ -353,12 +356,13 @@ public class CodeGeneratorCliEditorTest {
final AxStateTaskReference tr = e.getValue();
final AxReferenceKey trkey = tr.getKey();
- final ST val = cg.createPolicyStateTask(new PolicyStateTaskBuilder()
- .setPolicyName(kig.getPName(skey)).setVersion(kig.getPVersion(skey))
- .setStateName(kig.getLName(skey)).setTaskLocalName(kig.getLName(trkey))
- .setTaskName(kig.getName(tkey)).setTaskVersion(kig.getVersion(tkey))
- .setOutputType(tr.getStateTaskOutputType().name())
- .setOutputName(kig.getLName(tr.getOutput())));
+ final ST val = cg.createPolicyStateTask(PolicyStateTask.builder()
+ .policyName(kig.getPName(skey)).version(kig.getPVersion(skey))
+ .stateName(kig.getLName(skey)).taskLocalName(kig.getLName(trkey))
+ .taskName(kig.getName(tkey)).taskVersion(kig.getVersion(tkey))
+ .outputType(tr.getStateTaskOutputType().name())
+ .outputName(kig.getLName(tr.getOutput()))
+ .build());
ret.add(val);
}