Use CompareToBuilder 22/123522/1
authorJim Hahn <jrh3@att.com>
Tue, 24 Aug 2021 17:20:26 +0000 (13:20 -0400)
committerJim Hahn <jrh3@att.com>
Tue, 24 Aug 2021 19:51:34 +0000 (15:51 -0400)
Also added lombok to test classes.

Issue-ID: POLICY-3391
Change-Id: I9ecf479f3861a2e5211b037e885029d1719b6a56
Signed-off-by: Jim Hahn <jrh3@att.com>
35 files changed:
auth/cli-codegen/src/test/java/org/onap/policy/apex/auth/clicodegen/DummyStErrorListener.java
auth/cli-codegen/src/test/java/org/onap/policy/apex/auth/clicodegen/SupportKeyInfoGetter.java
auth/cli-editor/src/test/java/org/onap/policy/apex/auth/clieditor/tosca/CommonTestData.java
context/context-management/src/test/java/org/onap/policy/apex/context/impl/schema/java/SupportBaseClass.java
core/core-engine/src/test/java/org/onap/policy/apex/core/engine/executor/DummyStateFinalizerExecutor.java
core/core-engine/src/test/java/org/onap/policy/apex/core/engine/executor/DummyTaskExecutor.java
core/core-engine/src/test/java/org/onap/policy/apex/core/engine/executor/DummyTaskSelectExecutor.java
core/core-engine/src/test/java/org/onap/policy/apex/core/engine/executor/StateMachineExecutorTest.java
core/core-engine/src/test/java/org/onap/policy/apex/core/engine/executor/context/DummyContextAlbum.java
core/core-protocols/src/test/java/org/onap/policy/apex/core/protocols/DummyAction.java
core/core-protocols/src/test/java/org/onap/policy/apex/core/protocols/SupportMessageTester.java
examples/examples-aadm/src/test/java/org/onap/policy/apex/examples/aadm/TestApexActionListener.java
examples/examples-adaptive/src/test/java/org/onap/policy/apex/examples/adaptive/TestApexActionListener.java
examples/examples-myfirstpolicy/src/test/java/org/onap/policy/apex/examples/myfirstpolicy/TestSaleAuthListener.java
plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/test/java/org/onap/policy/apex/plugins/event/carrier/restclient/SupportApexEventReceiver.java
plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restserver/src/test/java/org/onap/policy/apex/plugins/event/carrier/restserver/SupportApexEventReceiver.java
plugins/plugins-event/plugins-event-protocol/plugins-event-protocol-xml/src/test/java/org/onap/policy/apex/plugins/event/protocol/xml/XmlEventGenerator.java
plugins/plugins-persistence/plugins-persistence-jpa/plugins-persistence-jpa-eclipselink/src/test/java/org/onap/policy/apex/plugins/persistence/jpa/eclipselink/entities/ArtifactKeyTestEntity.java
plugins/plugins-persistence/plugins-persistence-jpa/plugins-persistence-jpa-eclipselink/src/test/java/org/onap/policy/apex/plugins/persistence/jpa/eclipselink/entities/ReferenceKeyTestEntity.java
services/services-engine/src/test/java/org/onap/policy/apex/service/engine/event/testpojos/DummyPojo.java
services/services-engine/src/test/java/org/onap/policy/apex/service/engine/event/testpojos/DummyPojoList.java
services/services-engine/src/test/java/org/onap/policy/apex/service/engine/event/testpojos/DummySubPojo.java
services/services-engine/src/test/java/org/onap/policy/apex/service/engine/event/testpojos/DummySubSubPojo.java
services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/dummyclasses/DummyStateFinalizerExecutor.java
services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/dummyclasses/DummyTaskExecutor.java
services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/dummyclasses/DummyTaskSelectExecutor.java
services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/dummyclasses/SuperDooperCarrierTechnologyParameters.java
services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/dummyclasses/SuperDooperDistributorParameters.java
services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/dummyclasses/SuperDooperEventProducer.java
services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/dummyclasses/SuperDooperEventSubscriber.java
services/services-onappf/src/test/java/org/onap/policy/apex/services/onappf/parameters/dummyclasses/DummyStateFinalizerExecutor.java
services/services-onappf/src/test/java/org/onap/policy/apex/services/onappf/parameters/dummyclasses/DummyTaskExecutor.java
services/services-onappf/src/test/java/org/onap/policy/apex/services/onappf/parameters/dummyclasses/DummyTaskSelectExecutor.java
testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/entities/ArtifactKeyTestEntity.java
testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/entities/ReferenceKeyTestEntity.java

index 45d307b..572b40e 100644 (file)
@@ -1,25 +1,29 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. 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.
  * 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.auth.clicodegen;
 
+import lombok.AccessLevel;
+import lombok.Getter;
+import lombok.Setter;
 import org.stringtemplate.v4.STErrorListener;
 import org.stringtemplate.v4.misc.STMessage;
 
@@ -31,6 +35,8 @@ import org.stringtemplate.v4.misc.STMessage;
 public class DummyStErrorListener implements STErrorListener {
 
     /** Counts errors of the listener. */
+    @Getter(AccessLevel.PROTECTED)
+    @Setter(AccessLevel.PROTECTED)
     private int errorCount;
 
     /**
@@ -90,22 +96,4 @@ public class DummyStErrorListener implements STErrorListener {
         setErrorCount(getErrorCount() + 1);
         System.err.println("STG/ST (" + msg.error + ") " + msg.arg + " -> " + msg.cause);
     }
-
-    /**
-     * Gets the error count.
-     *
-     * @return the error count
-     */
-    protected int getErrorCount() {
-        return errorCount;
-    }
-
-    /**
-     * Sets the error count.
-     *
-     * @param errorCount the new error count
-     */
-    protected void setErrorCount(final int errorCount) {
-        this.errorCount = errorCount;
-    }
 }
index 5547aa4..5679916 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. 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.
@@ -20,6 +21,7 @@
 
 package org.onap.policy.apex.auth.clicodegen;
 
+import lombok.AllArgsConstructor;
 import org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey;
 import org.onap.policy.apex.model.basicmodel.concepts.AxKeyInfo;
 import org.onap.policy.apex.model.basicmodel.concepts.AxReferenceKey;
@@ -30,21 +32,12 @@ import org.onap.policy.apex.model.policymodel.concepts.AxPolicyModel;
  *
  * @author John Keeney (john.keeney@ericsson.com)
  */
-
+@AllArgsConstructor
 public class SupportKeyInfoGetter {
 
     /** The policy model for the getters. */
     private final AxPolicyModel model;
 
-    /**
-     * Creates a new key getter.
-     *
-     * @param model the policy model to use
-     */
-    public SupportKeyInfoGetter(final AxPolicyModel model) {
-        this.model = model;
-    }
-
     /**
      * Returns the key name as string.
      *
index ce88f97..23d927e 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2019 Nordix Foundation.
+ *  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.
 
 package org.onap.policy.apex.auth.clieditor.tosca;
 
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+
 /**
  * Class to hold/create all parameters for test cases.
  *
  * @author Ajith Sreekumar (ajith.sreekumar@est.tech)
  */
-public class CommonTestData {
-
-    private CommonTestData() {
-     // This class cannot be initialized
-    }
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class CommonTestData {
 
     public static final String INPUT_TOSCA_TEMPLATE_FILE_NAME = "src/test/resources/tosca/ToscaTemplate.json";
     public static final String APEX_CONFIG_FILE_NAME = "src/test/resources/tosca/ApexConfig.json";
index 0047375..6dd090e 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. 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.
 
 package org.onap.policy.apex.context.impl.schema.java;
 
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+@Getter
+@AllArgsConstructor
 public class SupportBaseClass {
     final String stringField;
-
-    public SupportBaseClass(final String stringField) {
-        this.stringField = stringField;
-    }
-
-    public String getStringField() {
-        return stringField;
-    }
 }
index 5a011b2..e4e3ddf 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2018 Ericsson. All rights reserved.
  *  Modifications Copyright (C) 2019 Nordix Foundation.
+ *  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.
@@ -23,21 +24,19 @@ package org.onap.policy.apex.core.engine.executor;
 
 import java.util.Map;
 import java.util.Properties;
+import lombok.NoArgsConstructor;
 import org.onap.policy.apex.context.ContextException;
 import org.onap.policy.apex.core.engine.executor.exception.StateMachineException;
 
 /**
  * Dummy state finalizer executor for testing.
  */
+@NoArgsConstructor
 public class DummyStateFinalizerExecutor extends StateFinalizerExecutor {
     private boolean override;
 
     private boolean returnBad;
 
-    public DummyStateFinalizerExecutor() {
-        this(false);
-    }
-
     public DummyStateFinalizerExecutor(final boolean override) {
         this.override = override;
     }
index 75c4c0d..8172eef 100644 (file)
@@ -3,6 +3,7 @@
  *  Copyright (C) 2018 Ericsson. All rights reserved.
  *  Modifications Copyright (C) 2019-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.
@@ -24,6 +25,8 @@ package org.onap.policy.apex.core.engine.executor;
 
 import java.util.Map;
 import java.util.Properties;
+import lombok.AllArgsConstructor;
+import lombok.NoArgsConstructor;
 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;
@@ -34,18 +37,12 @@ import org.onap.policy.apex.model.policymodel.concepts.AxTask;
 /**
  * Dummy task executor for testing.
  */
+@NoArgsConstructor
+@AllArgsConstructor
 public class DummyTaskExecutor extends TaskExecutor {
     private static final String EVENT_KEY = "Event1:0.0.1";
     private boolean override;
 
-    public DummyTaskExecutor() {
-        this(false);
-    }
-
-    public DummyTaskExecutor(final boolean override) {
-        this.override = override;
-    }
-
     @Override
     public void prepare() throws StateMachineException {
         if (!override) {
index 02a32d4..a5525ac 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2018 Ericsson. All rights reserved.
  *  Modifications Copyright (C) 2019 Nordix Foundation.
+ *  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.
@@ -22,6 +23,9 @@
 package org.onap.policy.apex.core.engine.executor;
 
 import java.util.Properties;
+import lombok.AllArgsConstructor;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
 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;
@@ -30,19 +34,14 @@ import org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey;
 /**
  * Dummy task selection executor for testing.
  */
+@NoArgsConstructor
+@AllArgsConstructor
 public class DummyTaskSelectExecutor extends TaskSelectExecutor {
     private boolean override;
 
+    @Setter
     private static int taskNo;
 
-    public DummyTaskSelectExecutor() {
-        this(false);
-    }
-
-    public DummyTaskSelectExecutor(final boolean override) {
-        this.override = override;
-    }
-
     @Override
     public void prepare() throws StateMachineException {
         if (!override) {
@@ -63,10 +62,6 @@ public class DummyTaskSelectExecutor extends TaskSelectExecutor {
         return new AxArtifactKey("task" + (taskNo++) + ":0.0.1");
     }
 
-    public void setTaskNo(int incomingTaskNo) {
-        taskNo = incomingTaskNo;
-    }
-
     /**
      * {@inheritDoc}.
      */
index 2d274bd..5d91bd2 100644 (file)
@@ -3,6 +3,7 @@
  *  Copyright (C) 2018 Ericsson. All rights reserved.
  *  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.
@@ -222,26 +223,26 @@ public class StateMachineExecutorTest {
         executor.setContext(null, axPolicy, internalContextMock);
         executor.execute(0, null, incomingEventMock);
 
-        dummyTsle.setTaskNo(0);
+        DummyTaskSelectExecutor.setTaskNo(0);
         executor.execute(0, null, incomingEventMock);
 
         AxReferenceKey badStateKey = new AxReferenceKey("Policy:0.0.1:PName:BadState");
         axPolicy.getStateMap().get("State1").getStateOutputs().get("stateOutput1").setNextState(badStateKey);
-        dummyTsle.setTaskNo(0);
+        DummyTaskSelectExecutor.setTaskNo(0);
         assertThatThrownBy(() -> executor.execute(0, null, incomingEventMock))
             .hasMessage("state execution failed, next state \"Policy:0.0.1:PName:BadState\" not found");
         axPolicy.getStateMap().get("State1").getStateOutputs().get("stateOutput1")
             .setNextState(AxReferenceKey.getNullKey());
-        dummyTsle.setTaskNo(0);
+        DummyTaskSelectExecutor.setTaskNo(0);
         executor.execute(0, null, incomingEventMock);
 
         axPolicy.getStateMap().get("State1").setTrigger(new AxArtifactKey("BadTrigger:0.0.1"));
-        dummyTsle.setTaskNo(0);
+        DummyTaskSelectExecutor.setTaskNo(0);
         assertThatThrownBy(() -> executor.execute(0, null, incomingEventMock))
             .hasMessage("incoming event \"Event1:0.0.1\" does not match trigger \"BadTrigger:0.0.1\" "
                 + "of state \"Policy:0.0.1:NULL:state1\"");
         axPolicy.getStateMap().get("State1").setTrigger(new AxArtifactKey("Event1:0.0.1"));
-        dummyTsle.setTaskNo(0);
+        DummyTaskSelectExecutor.setTaskNo(0);
         executor.execute(0, null, incomingEventMock);
 
         AxStateFinalizerLogic savedSfl = axPolicy.getStateMap().get("State1").getStateFinalizerLogicMap().get("sfl");
@@ -255,7 +256,7 @@ public class StateMachineExecutorTest {
         axPolicy.getStateMap().get("State1").getStateFinalizerLogicMap().put("sfl", savedSfl);
         executor.setContext(null, axPolicy, internalContextMock);
 
-        dummyTsle.setTaskNo(0);
+        DummyTaskSelectExecutor.setTaskNo(0);
         executor.execute(0, null, incomingEventMock);
 
         AxArtifactKey task1Key = new AxArtifactKey("task1:0.0.1");
@@ -271,16 +272,16 @@ public class StateMachineExecutorTest {
             .setStateTaskOutputType(AxStateTaskOutputType.LOGIC);
         executor.setContext(null, axPolicy, internalContextMock);
 
-        dummyTsle.setTaskNo(0);
+        DummyTaskSelectExecutor.setTaskNo(0);
         executor.execute(0, null, incomingEventMock);
 
-        dummyTsle.setTaskNo(0);
+        DummyTaskSelectExecutor.setTaskNo(0);
         dummySfle.setReturnBad(true);
         assertThatThrownBy(() -> executor.execute(0, null, incomingEventMock))
             .hasMessage("State execution of state \"Policy:0.0.1:NULL:state1\" on task \"task1:0.0.1\""
                 + " failed: state output definition for state output \"stateOutputBad\" not found for "
                 + "state \"Policy:0.0.1:NULL:state1\"");
-        dummyTsle.setTaskNo(0);
+        DummyTaskSelectExecutor.setTaskNo(0);
         dummySfle.setReturnBad(false);
         executor.execute(0, null, incomingEventMock);
 
index 156e64b..efb53a6 100644 (file)
@@ -1,19 +1,20 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2018 Ericsson. 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.
  * 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=========================================================
  */
@@ -23,6 +24,7 @@ package org.onap.policy.apex.core.engine.executor.context;
 import java.util.Collection;
 import java.util.Map;
 import java.util.Set;
+import lombok.AllArgsConstructor;
 import org.apache.commons.lang3.NotImplementedException;
 import org.onap.policy.apex.context.ContextAlbum;
 import org.onap.policy.apex.context.ContextException;
@@ -34,18 +36,10 @@ import org.onap.policy.apex.model.contextmodel.concepts.AxContextAlbum;
 /**
  * Dummy context album for testing.
  */
+@AllArgsConstructor
 public class DummyContextAlbum implements ContextAlbum {
     private final AxArtifactKey key;
 
-    /**
-     * Constructor.
-     * @param key the key
-     */
-    public DummyContextAlbum(AxArtifactKey key) {
-        super();
-        this.key = key;
-    }
-
     /**
      * {@inheritDoc}.
      */
@@ -53,7 +47,7 @@ public class DummyContextAlbum implements ContextAlbum {
     public void clear() {
         throw new NotImplementedException("Not implemented on dummy class");
     }
-    
+
     /**
      * {@inheritDoc}.
      */
index 3d15a8c..8760522 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2018 Ericsson. All rights reserved.
  *  Modifications Copyright (C) 2020 Nordix Foundation.
+ *  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.
 
 package org.onap.policy.apex.core.protocols;
 
+import lombok.AllArgsConstructor;
+import lombok.EqualsAndHashCode;
+import lombok.Getter;
+import lombok.Setter;
+
 /**
  * Dummy action for testing.
  */
+@Getter
+@Setter
+@EqualsAndHashCode
+@AllArgsConstructor
 public class DummyAction implements Action {
     private static final long serialVersionUID = 9178856761163651594L;
 
     private String actionString = "An Action String";
-
-    public DummyAction(final String actionString) {
-        this.actionString = actionString;
-    }
-
-    /**
-     * {@inheritDoc}.
-     */
-    @Override
-    public String getActionString() {
-        return actionString;
-    }
-
-    public void setActionString(final String actionString) {
-        this.actionString = actionString;
-    }
-
-    @Override
-    public int hashCode() {
-        final int prime = 31;
-        int result = 1;
-        result = prime * result + ((actionString == null) ? 0 : actionString.hashCode());
-        return result;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj) {
-            return true;
-        }
-
-        if (obj == null) {
-            return false;
-        }
-
-        if (getClass() != obj.getClass()) {
-            return false;
-        }
-
-        DummyAction other = (DummyAction) obj;
-        if (actionString == null) {
-            if (other.actionString != null) {
-                return false;
-            }
-        } else if (!actionString.equals(other.actionString)) {
-            return false;
-        }
-        return true;
-    }
 }
index f275f4b..7bc3520 100644 (file)
@@ -22,6 +22,7 @@
 
 package org.onap.policy.apex.core.protocols;
 
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotEquals;
 import static org.junit.Assert.assertNotNull;
@@ -41,8 +42,9 @@ public class SupportMessageTester {
 
         DummyMessage dummyMessage = new DummyMessage(new DummyAction(null), new AxArtifactKey("Target:0.0.1"));
         assertEquals(new DummyAction(null), dummyMessage.getAction());
-        assertEquals("Message(action=org.onap.policy.apex.core.protocols.DummyAction@1f, "
-            + "targetKey=AxArtifactKey:(name=Target,version=0.0.1), messageData=null)", dummyMessage.toString());
+        assertThat(dummyMessage.toString())
+            .startsWith("Message(action=org.onap.policy.apex.core.protocols.DummyAction@")
+            .endsWith("targetKey=AxArtifactKey:(name=Target,version=0.0.1), messageData=null)");
 
         dummyMessage.setMessageData("Message Data");
         assertEquals("Message Data", dummyMessage.getMessageData());
index 37a916a..825ce58 100644 (file)
@@ -24,6 +24,7 @@ package org.onap.policy.apex.examples.aadm;
 
 import java.util.ArrayList;
 import java.util.List;
+import lombok.AllArgsConstructor;
 import lombok.Getter;
 import org.onap.policy.apex.core.engine.engine.EnEventListener;
 import org.onap.policy.apex.core.engine.event.EnEvent;
@@ -36,21 +37,13 @@ import org.onap.policy.apex.core.engine.event.EnEvent;
  *
  * @author Liam Fallon (liam.fallon@ericsson.com)
  */
+@AllArgsConstructor
 public class TestApexActionListener implements EnEventListener {
-    List<EnEvent> resultEvents = new ArrayList<EnEvent>();
+    private final List<EnEvent> resultEvents = new ArrayList<EnEvent>();
 
     @Getter
     private final String id;
 
-    /**
-     * Instantiates a new test apex action listener.
-     *
-     * @param id the id
-     */
-    public TestApexActionListener(final String id) {
-        this.id = id;
-    }
-
     /**
      * Gets the result.
      *
index 702b050..273d8b7 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
  *  Modifications Copyright (C) 2020 Nordix Foundation.
+ *  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.
@@ -26,6 +27,8 @@ import static org.awaitility.Awaitility.await;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.concurrent.TimeUnit;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
 import org.onap.policy.apex.core.engine.engine.EnEventListener;
 import org.onap.policy.apex.core.engine.event.EnEvent;
 
@@ -37,20 +40,13 @@ import org.onap.policy.apex.core.engine.event.EnEvent;
  *
  * @author Liam Fallon (liam.fallon@ericsson.com)
  */
+@AllArgsConstructor
 public class TestApexActionListener implements EnEventListener {
-    private List<EnEvent> resultEvents = new ArrayList<>();
+    private final List<EnEvent> resultEvents = new ArrayList<>();
 
+    @Getter
     private final String id;
 
-    /**
-     * Instantiates a new test apex action listener.
-     *
-     * @param id the id
-     */
-    public TestApexActionListener(final String id) {
-        this.id = id;
-    }
-
     /**
      * Gets the result.
      *
@@ -71,13 +67,4 @@ public class TestApexActionListener implements EnEventListener {
             resultEvents.add(actionEvent);
         }
     }
-
-    /**
-     * Gets the id.
-     *
-     * @return the id
-     */
-    public String getId() {
-        return id;
-    }
 }
index 1281c51..01c24d6 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
  *  Modifications Copyright (C) 2020 Nordix Foundation.
+ *  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.
@@ -26,6 +27,8 @@ import static org.awaitility.Awaitility.await;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.concurrent.TimeUnit;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
 import org.onap.policy.apex.core.engine.engine.EnEventListener;
 import org.onap.policy.apex.core.engine.event.EnEvent;
 
@@ -37,22 +40,15 @@ import org.onap.policy.apex.core.engine.event.EnEvent;
  *
  * @author Liam Fallon (liam.fallon@ericsson.com)
  */
+@AllArgsConstructor
 public class TestSaleAuthListener implements EnEventListener {
     // CHECKSTYLE:OFF: MagicNumber
 
     private final List<EnEvent> resultEvents = new ArrayList<>();
 
+    @Getter
     private final String id;
 
-    /**
-     * Instantiates a new action listener.
-     *
-     * @param id the id
-     */
-    public TestSaleAuthListener(final String id) {
-        this.id = id;
-    }
-
     /**
      * Gets the result.
      *
@@ -73,13 +69,4 @@ public class TestSaleAuthListener implements EnEventListener {
             resultEvents.add(saleauthEvent);
         }
     }
-
-    /**
-     * Gets the id.
-     *
-     * @return the id
-     */
-    public String getId() {
-        return id;
-    }
 }
index f220137..49135f5 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2018 Ericsson. All rights reserved.
  *  Modifications Copyright (C) 2019 Nordix Foundation.
+ *  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.
@@ -22,6 +23,7 @@
 package org.onap.policy.apex.plugins.event.carrier.restclient;
 
 import java.util.Properties;
+import lombok.Getter;
 import org.onap.policy.apex.service.engine.event.ApexEventException;
 import org.onap.policy.apex.service.engine.event.ApexEventReceiver;
 
@@ -29,6 +31,7 @@ import org.onap.policy.apex.service.engine.event.ApexEventReceiver;
  * Support Apex event reveiver for unit test.
  *
  */
+@Getter
 public class SupportApexEventReceiver implements ApexEventReceiver {
     private long lastExecutionId;
     private Object lastEvent;
@@ -53,21 +56,4 @@ public class SupportApexEventReceiver implements ApexEventReceiver {
         this.lastEvent = event;
         this.eventCount++;
     }
-
-    public long getLastExecutionId() {
-        return lastExecutionId;
-    }
-
-    public Object getLastEvent() {
-        return lastEvent;
-    }
-
-    /**
-     * Get the number of events received.
-     *
-     * @return the number of events received
-     */
-    public int getEventCount() {
-        return eventCount;
-    }
 }
index cd60c22..773ecaf 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2018 Ericsson. 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.
@@ -21,6 +22,7 @@
 package org.onap.policy.apex.plugins.event.carrier.restserver;
 
 import java.util.Properties;
+import lombok.Getter;
 import org.onap.policy.apex.service.engine.event.ApexEventException;
 import org.onap.policy.apex.service.engine.event.ApexEventReceiver;
 
@@ -28,6 +30,7 @@ import org.onap.policy.apex.service.engine.event.ApexEventReceiver;
  * Support Apex event reveiver for unit test.
  *
  */
+@Getter
 public class SupportApexEventReceiver implements ApexEventReceiver {
     private long lastExecutionId;
     private Object lastEvent;
@@ -52,21 +55,4 @@ public class SupportApexEventReceiver implements ApexEventReceiver {
         this.lastEvent = event;
         this.eventCount++;
     }
-
-    public long getLastExecutionId() {
-        return lastExecutionId;
-    }
-
-    public Object getLastEvent() {
-        return lastEvent;
-    }
-
-    /**
-     * Get the number of events received.
-     *
-     * @return the number of events received
-     */
-    public int getEventCount() {
-        return eventCount;
-    }
 }
index f85d911..9c8696c 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. 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.
 package org.onap.policy.apex.plugins.event.protocol.xml;
 
 import java.util.Random;
+import lombok.Getter;
 
 /**
  * The Class XmlEventGenerator.
  */
 public class XmlEventGenerator {
+    @Getter
     private static int nextEventNo = 0;
 
     /**
@@ -113,13 +116,4 @@ public class XmlEventGenerator {
 
         System.out.println(xmlEvents(eventCount));
     }
-
-    /**
-     * Gets the next event no.
-     *
-     * @return the next event no
-     */
-    public static int getNextEventNo() {
-        return nextEventNo;
-    }
 }
index f1561c2..98a4c57 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2019 Nordix Foundation.
+ *  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.
@@ -26,6 +27,11 @@ import javax.persistence.EmbeddedId;
 import javax.persistence.Entity;
 import javax.persistence.Table;
 import javax.xml.bind.annotation.XmlElement;
+import lombok.EqualsAndHashCode;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+import org.apache.commons.lang3.builder.CompareToBuilder;
 import org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey;
 import org.onap.policy.apex.model.basicmodel.concepts.AxConcept;
 import org.onap.policy.apex.model.basicmodel.concepts.AxKey;
@@ -36,6 +42,10 @@ import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult;
  */
 @Entity
 @Table(name = "ArtifactKeyTestEntity")
+@Getter
+@Setter
+@ToString
+@EqualsAndHashCode(callSuper = false)
 public class ArtifactKeyTestEntity extends AxConcept {
     private static final long serialVersionUID = -2962570563281067896L;
 
@@ -74,14 +84,6 @@ public class ArtifactKeyTestEntity extends AxConcept {
         this.doubleValue = doubleValue;
     }
 
-    /**
-     * {@inheritDoc}.
-     */
-    @Override
-    public AxArtifactKey getKey() {
-        return key;
-    }
-
     /**
      * {@inheritDoc}.
      */
@@ -90,15 +92,6 @@ public class ArtifactKeyTestEntity extends AxConcept {
         return Arrays.asList((AxKey) getKey());
     }
 
-    /**
-     * Sets the key.
-     *
-     * @param key the new key
-     */
-    public void setKey(final AxArtifactKey key) {
-        this.key = key;
-    }
-
     /**
      * Check set key.
      *
@@ -108,24 +101,6 @@ public class ArtifactKeyTestEntity extends AxConcept {
         return (this.key != null);
     }
 
-    /**
-     * Gets the double value.
-     *
-     * @return the double value
-     */
-    public double getDoubleValue() {
-        return doubleValue;
-    }
-
-    /**
-     * Sets the double value.
-     *
-     * @param doubleValue the new double value
-     */
-    public void setDoubleValue(final double doubleValue) {
-        this.doubleValue = doubleValue;
-    }
-
     /**
      * {@inheritDoc}.
      */
@@ -142,14 +117,6 @@ public class ArtifactKeyTestEntity extends AxConcept {
         key.clean();
     }
 
-    /**
-     * {@inheritDoc}.
-     */
-    @Override
-    public String toString() {
-        return "ArtifactKeyTestEntity [key=" + key + ", doubleValue=" + doubleValue + "]";
-    }
-
     /**
      * {@inheritDoc}.
      */
@@ -170,42 +137,6 @@ public class ArtifactKeyTestEntity extends AxConcept {
         }
     }
 
-    /**
-     * {@inheritDoc}.
-     */
-    @Override
-    public int hashCode() {
-        final int prime = 31;
-        int result = 1;
-        result = prime * result + ((key == null) ? 0 : key.hashCode());
-        return result;
-    }
-
-    /**
-     * {@inheritDoc}.
-     */
-    @Override
-    public boolean equals(final Object obj) {
-        if (obj == null) {
-            return false;
-        }
-        if (this == obj) {
-            return true;
-        }
-        if (getClass() != obj.getClass()) {
-            return false;
-        }
-        final ArtifactKeyTestEntity other = (ArtifactKeyTestEntity) obj;
-        if (key == null) {
-            if (other.key != null) {
-                return false;
-            }
-        } else if (!key.equals(other.key)) {
-            return false;
-        }
-        return (Double.compare(doubleValue, other.doubleValue) == 0);
-    }
-
     /**
      * {@inheritDoc}.
      */
@@ -221,13 +152,9 @@ public class ArtifactKeyTestEntity extends AxConcept {
             return -1;
         }
         final ArtifactKeyTestEntity other = (ArtifactKeyTestEntity) otherObj;
-        if (key == null) {
-            if (other.key != null) {
-                return 1;
-            }
-        } else if (!key.equals(other.key)) {
-            return key.compareTo(other.key);
-        }
-        return Double.compare(doubleValue, other.doubleValue);
+        return new CompareToBuilder()
+                        .append(key, other.key)
+                        .append(doubleValue, other.doubleValue)
+                        .toComparison();
     }
 }
index afeeb84..cadc9b8 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2019 Nordix Foundation.
+ *  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.
@@ -27,6 +28,11 @@ import javax.persistence.Entity;
 import javax.persistence.Table;
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import lombok.EqualsAndHashCode;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+import org.apache.commons.lang3.builder.CompareToBuilder;
 import org.onap.policy.apex.model.basicmodel.concepts.AxConcept;
 import org.onap.policy.apex.model.basicmodel.concepts.AxKey;
 import org.onap.policy.apex.model.basicmodel.concepts.AxReferenceKey;
@@ -38,6 +44,10 @@ import org.onap.policy.apex.model.basicmodel.xml.AxReferenceKeyAdapter;
  */
 @Entity
 @Table(name = "ReferenceKeyTestEntity")
+@Getter
+@Setter
+@ToString
+@EqualsAndHashCode(callSuper = false)
 public class ReferenceKeyTestEntity extends AxConcept {
     private static final long serialVersionUID = -2962570563281067895L;
 
@@ -77,14 +87,6 @@ public class ReferenceKeyTestEntity extends AxConcept {
         this.doubleValue = doubleValue;
     }
 
-    /**
-     * {@inheritDoc}.
-     */
-    @Override
-    public AxReferenceKey getKey() {
-        return key;
-    }
-
     /**
      * {@inheritDoc}.
      */
@@ -93,15 +95,6 @@ public class ReferenceKeyTestEntity extends AxConcept {
         return Arrays.asList((AxKey) getKey());
     }
 
-    /**
-     * Sets the key.
-     *
-     * @param key the new key
-     */
-    public void setKey(final AxReferenceKey key) {
-        this.key = key;
-    }
-
     /**
      * Check set key.
      *
@@ -111,24 +104,6 @@ public class ReferenceKeyTestEntity extends AxConcept {
         return (this.key != null);
     }
 
-    /**
-     * Gets the double value.
-     *
-     * @return the double value
-     */
-    public double getDoubleValue() {
-        return doubleValue;
-    }
-
-    /**
-     * Sets the double value.
-     *
-     * @param doubleValue the new double value
-     */
-    public void setDoubleValue(final double doubleValue) {
-        this.doubleValue = doubleValue;
-    }
-
     /**
      * {@inheritDoc}.
      */
@@ -145,14 +120,6 @@ public class ReferenceKeyTestEntity extends AxConcept {
         key.clean();
     }
 
-    /**
-     * {@inheritDoc}.
-     */
-    @Override
-    public String toString() {
-        return "ReferenceKeyTestEntity [key=" + key + ", doubleValue=" + doubleValue + "]";
-    }
-
     /**
      * {@inheritDoc}.
      */
@@ -173,42 +140,6 @@ public class ReferenceKeyTestEntity extends AxConcept {
         }
     }
 
-    /**
-     * {@inheritDoc}.
-     */
-    @Override
-    public int hashCode() {
-        final int prime = 31;
-        int result = 1;
-        result = prime * result + ((key == null) ? 0 : key.hashCode());
-        return result;
-    }
-
-    /**
-     * {@inheritDoc}.
-     */
-    @Override
-    public boolean equals(final Object obj) {
-        if (obj == null) {
-            return false;
-        }
-        if (this == obj) {
-            return true;
-        }
-        if (getClass() != obj.getClass()) {
-            return false;
-        }
-        final ReferenceKeyTestEntity other = (ReferenceKeyTestEntity) obj;
-        if (key == null) {
-            if (other.key != null) {
-                return false;
-            }
-        } else if (!key.equals(other.key)) {
-            return false;
-        }
-        return (Double.compare(doubleValue, other.doubleValue) == 0);
-    }
-
     /**
      * {@inheritDoc}.
      */
@@ -224,13 +155,9 @@ public class ReferenceKeyTestEntity extends AxConcept {
             return -1;
         }
         final ReferenceKeyTestEntity other = (ReferenceKeyTestEntity) otherObj;
-        if (key == null) {
-            if (other.key != null) {
-                return 1;
-            }
-        } else if (!key.equals(other.key)) {
-            return key.compareTo(other.key);
-        }
-        return Double.compare(doubleValue, other.doubleValue);
+        return new CompareToBuilder()
+                        .append(key, other.key)
+                        .append(doubleValue, other.doubleValue)
+                        .toComparison();
     }
 }
index f87c725..f6902f9 100644 (file)
@@ -1,69 +1,36 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2018 Ericsson. 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.
  * 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.service.engine.event.testpojos;
 
+import lombok.Getter;
+
 /**
  * A test Pojo for pojo decoding and encoding in Apex.
  */
+@Getter
 public class DummyPojo {
     private int anInt;
     private Integer anInteger;
     private String someString;
-    
-    private DummySubPojo testSubPojo;
-
-    /**
-     * Gets the an int.
-     *
-     * @return the an int
-     */
-    public int getAnInt() {
-        return anInt;
-    }
-
-    /**
-     * Gets the an integer.
-     *
-     * @return the an integer
-     */
-    public Integer getAnInteger() {
-        return anInteger;
-    }
-
-    /**
-     * Gets the a string.
-     *
-     * @return the a string
-     */
-    public String getSomeString() {
-        return someString;
-    }
-
-    /**
-     * Gets the test sub pojo.
-     *
-     * @return the test sub pojo
-     */
-    public DummySubPojo getTestSubPojo() {
-        return testSubPojo;
-    }
 
+    private DummySubPojo testSubPojo;
 }
index 13c0e96..8a0d82d 100644 (file)
@@ -1,19 +1,20 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2018 Ericsson. 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.
  * 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.service.engine.event.testpojos;
 
 import java.util.List;
+import lombok.Getter;
 
 /**
  * A test list of POJO for decoding and encoding.
  */
+@Getter
 public class DummyPojoList {
     private List<DummyPojo> testPojoList;
-
-    /**
-     * Gets the test pojo list.
-     *
-     * @return the test pojo list
-     */
-    public List<DummyPojo> getTestPojoList() {
-        return testPojoList;
-    }
 }
index 121cc81..48614a6 100644 (file)
@@ -1,69 +1,36 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2018 Ericsson. 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.
  * 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.service.engine.event.testpojos;
 
+import lombok.Getter;
+
 /**
  * A test Pojo for pojo decoding and encoding in Apex.
  */
+@Getter
 public class DummySubPojo {
     private int anInt;
     private Integer anInteger;
     private String someString;
-    
-    private DummySubSubPojo testSubSubPojo;
-
-    /**
-     * Gets the an int.
-     *
-     * @return the an int
-     */
-    public int getAnInt() {
-        return anInt;
-    }
-
-    /**
-     * Gets the an integer.
-     *
-     * @return the an integer
-     */
-    public Integer getAnInteger() {
-        return anInteger;
-    }
-
-    /**
-     * Gets the a string.
-     *
-     * @return the a string
-     */
-    public String getSomeString() {
-        return someString;
-    }
-
-    /**
-     * Gets the test sub sub pojo.
-     *
-     * @return the test sub sub pojo
-     */
-    public DummySubSubPojo getTestSubSubPojo() {
-        return testSubSubPojo;
-    }
 
+    private DummySubSubPojo testSubSubPojo;
 }
index d2e55f4..f10e433 100644 (file)
@@ -1,57 +1,34 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2018 Ericsson. 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.
  * 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.service.engine.event.testpojos;
 
+import lombok.Getter;
+
 /**
  * A test Pojo for pojo decoding and encoding in Apex.
  */
+@Getter
 public class DummySubSubPojo {
     private int anInt;
     private Integer anInteger;
     private String someString;
-
-    /**
-     * Gets the an int.
-     *
-     * @return the an int
-     */
-    public int getAnInt() {
-        return anInt;
-    }
-
-    /**
-     * Gets the an integer.
-     *
-     * @return the an integer
-     */
-    public Integer getAnInteger() {
-        return anInteger;
-    }
-
-    /**
-     * Gets the a string.
-     *
-     * @return the a string
-     */
-    public String getSomeString() {
-        return someString;
-    }
 }
index ec06ce9..c12db96 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2018 Ericsson. 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.
@@ -30,9 +31,6 @@ import org.onap.policy.apex.core.engine.executor.exception.StateMachineException
  * Dummy state finalizer executor for testing.
  */
 public class DummyStateFinalizerExecutor extends StateFinalizerExecutor {
-    public DummyStateFinalizerExecutor() {
-        // Default constructor
-    }
 
     @Override
     public String execute(final long executionId, final Properties executorProperties,
index 56f0af5..d4b4002 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2018 Ericsson. All rights reserved.
  *  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.
@@ -34,9 +35,6 @@ import org.onap.policy.apex.model.policymodel.concepts.AxTask;
  * Dummy task executor for testing.
  */
 public class DummyTaskExecutor extends TaskExecutor {
-    public DummyTaskExecutor() {
-        // Default constructor
-    }
 
     @Override
     public void prepare() throws StateMachineException {
index 22f6b44..39374cd 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2018 Ericsson. 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.
@@ -31,8 +32,6 @@ import org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey;
  * Dummy task selection executor for testing.
  */
 public class DummyTaskSelectExecutor extends TaskSelectExecutor {
-    public DummyTaskSelectExecutor() {
-    }
 
     @Override
     public void prepare() throws StateMachineException {
index d7a502c..b23acdd 100644 (file)
@@ -24,6 +24,8 @@ package org.onap.policy.apex.service.engine.parameters.dummyclasses;
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.Properties;
+import lombok.Getter;
+import lombok.Setter;
 import org.apache.commons.lang3.StringUtils;
 import org.onap.policy.apex.service.parameters.carriertechnology.CarrierTechnologyParameters;
 import org.onap.policy.common.parameters.BeanValidationResult;
@@ -40,6 +42,8 @@ import org.onap.policy.models.base.Validated;
  */
 @NotNull
 @NotBlank
+@Getter
+@Setter
 public class SuperDooperCarrierTechnologyParameters extends CarrierTechnologyParameters {
     // Default parameter values
     private static final String DEFAULT_ACKS = "all";
@@ -149,114 +153,6 @@ public class SuperDooperCarrierTechnologyParameters extends CarrierTechnologyPar
         return superDooperProperties;
     }
 
-    /**
-     * Gets the bootstrap servers.
-     *
-     * @return the bootstrap servers
-     */
-    public String getBootstrapServers() {
-        return bootstrapServers;
-    }
-
-    /**
-     * Gets the acks.
-     *
-     * @return the acks
-     */
-    public String getAcks() {
-        return acks;
-    }
-
-    /**
-     * Gets the retries.
-     *
-     * @return the retries
-     */
-    public int getRetries() {
-        return retries;
-    }
-
-    /**
-     * Gets the batch size.
-     *
-     * @return the batch size
-     */
-    public int getBatchSize() {
-        return batchSize;
-    }
-
-    /**
-     * Gets the linger time.
-     *
-     * @return the linger time
-     */
-    public int getLingerTime() {
-        return lingerTime;
-    }
-
-    /**
-     * Gets the buffer memory.
-     *
-     * @return the buffer memory
-     */
-    public long getBufferMemory() {
-        return bufferMemory;
-    }
-
-    /**
-     * Gets the group id.
-     *
-     * @return the group id
-     */
-    public String getGroupId() {
-        return groupId;
-    }
-
-    /**
-     * Checks if is enable auto commit.
-     *
-     * @return true, if checks if is enable auto commit
-     */
-    public boolean isEnableAutoCommit() {
-        return enableAutoCommit;
-    }
-
-    /**
-     * Gets the auto commit time.
-     *
-     * @return the auto commit time
-     */
-    public int getAutoCommitTime() {
-        return autoCommitTime;
-    }
-
-    /**
-     * Gets the session timeout.
-     *
-     * @return the session timeout
-     */
-    public int getSessionTimeout() {
-        return sessionTimeout;
-    }
-
-    /**
-     * Gets the producer topic.
-     *
-     * @return the producer topic
-     */
-    public String getProducerTopic() {
-        return producerTopic;
-    }
-
-    /**
-     * Gets the consumer poll time.
-     *
-     * @return the consumer poll time
-     */
-    public long getConsumerPollTime() {
-        return consumerPollTime;
-    }
-
     /**
      * Gets the consumer topic list.
      *
@@ -266,195 +162,6 @@ public class SuperDooperCarrierTechnologyParameters extends CarrierTechnologyPar
         return Arrays.asList(consumerTopicList);
     }
 
-    /**
-     * Gets the key serializer.
-     *
-     * @return the key serializer
-     */
-    public String getKeySerializer() {
-        return keySerializer;
-    }
-
-    /**
-     * Gets the value serializer.
-     *
-     * @return the value serializer
-     */
-    public String getValueSerializer() {
-        return valueSerializer;
-    }
-
-    /**
-     * Gets the key deserializer.
-     *
-     * @return the key deserializer
-     */
-    public String getKeyDeserializer() {
-        return keyDeserializer;
-    }
-
-    /**
-     * Gets the value deserializer.
-     *
-     * @return the value deserializer
-     */
-    public String getValueDeserializer() {
-        return valueDeserializer;
-    }
-
-    /**
-     * Sets the bootstrap servers.
-     *
-     * @param bootstrapServers the new bootstrap servers
-     */
-    public void setBootstrapServers(String bootstrapServers) {
-        this.bootstrapServers = bootstrapServers;
-    }
-
-    /**
-     * Sets the acks.
-     *
-     * @param acks the new acks
-     */
-    public void setAcks(String acks) {
-        this.acks = acks;
-    }
-
-    /**
-     * Sets the retries.
-     *
-     * @param retries the new retries
-     */
-    public void setRetries(int retries) {
-        this.retries = retries;
-    }
-
-    /**
-     * Sets the batch size.
-     *
-     * @param batchSize the new batch size
-     */
-    public void setBatchSize(int batchSize) {
-        this.batchSize = batchSize;
-    }
-
-    /**
-     * Sets the linger time.
-     *
-     * @param lingerTime the new linger time
-     */
-    public void setLingerTime(int lingerTime) {
-        this.lingerTime = lingerTime;
-    }
-
-    /**
-     * Sets the buffer memory.
-     *
-     * @param bufferMemory the new buffer memory
-     */
-    public void setBufferMemory(long bufferMemory) {
-        this.bufferMemory = bufferMemory;
-    }
-
-    /**
-     * Sets the group id.
-     *
-     * @param groupId the new group id
-     */
-    public void setGroupId(String groupId) {
-        this.groupId = groupId;
-    }
-
-    /**
-     * Sets the enable auto commit.
-     *
-     * @param enableAutoCommit the new enable auto commit
-     */
-    public void setEnableAutoCommit(boolean enableAutoCommit) {
-        this.enableAutoCommit = enableAutoCommit;
-    }
-
-    /**
-     * Sets the auto commit time.
-     *
-     * @param autoCommitTime the new auto commit time
-     */
-    public void setAutoCommitTime(int autoCommitTime) {
-        this.autoCommitTime = autoCommitTime;
-    }
-
-    /**
-     * Sets the session timeout.
-     *
-     * @param sessionTimeout the new session timeout
-     */
-    public void setSessionTimeout(int sessionTimeout) {
-        this.sessionTimeout = sessionTimeout;
-    }
-
-    /**
-     * Sets the producer topic.
-     *
-     * @param producerTopic the new producer topic
-     */
-    public void setProducerTopic(String producerTopic) {
-        this.producerTopic = producerTopic;
-    }
-
-    /**
-     * Sets the consumer poll time.
-     *
-     * @param consumerPollTime the new consumer poll time
-     */
-    public void setConsumerPollTime(int consumerPollTime) {
-        this.consumerPollTime = consumerPollTime;
-    }
-
-    /**
-     * Sets the consumer topic list.
-     *
-     * @param consumerTopicList the new consumer topic list
-     */
-    public void setConsumerTopicList(String[] consumerTopicList) {
-        this.consumerTopicList = consumerTopicList;
-    }
-
-    /**
-     * Sets the key serializer.
-     *
-     * @param keySerializer the new key serializer
-     */
-    public void setKeySerializer(String keySerializer) {
-        this.keySerializer = keySerializer;
-    }
-
-    /**
-     * Sets the value serializer.
-     *
-     * @param valueSerializer the new value serializer
-     */
-    public void setValueSerializer(String valueSerializer) {
-        this.valueSerializer = valueSerializer;
-    }
-
-    /**
-     * Sets the key deserializer.
-     *
-     * @param keyDeserializer the new key deserializer
-     */
-    public void setKeyDeserializer(String keyDeserializer) {
-        this.keyDeserializer = keyDeserializer;
-    }
-
-    /**
-     * Sets the value deserializer.
-     *
-     * @param valueDeserializer the new value deserializer
-     */
-    public void setValueDeserializer(String valueDeserializer) {
-        this.valueDeserializer = valueDeserializer;
-    }
-
     /**
      * {@inheritDoc}.
      */
index 0d021c9..3c34369 100644 (file)
@@ -1,33 +1,40 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. 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.
  * 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.service.engine.parameters.dummyclasses;
 
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
 import org.onap.policy.apex.context.parameters.DistributorParameters;
 
 /**
  * Distributor parameters for the Super Dooper Distributor.
- * 
+ *
  * @author Liam Fallon (liam.fallon@ericsson.com)
  * @version
  */
+@Getter
+@Setter
+@ToString
 public class SuperDooperDistributorParameters extends DistributorParameters {
     // Constants for SuperDooper configuration file locations
     public static final String DEFAULT_SUPER_DOOPER_DISTRIBUTION_CONFIG_FILE = "superDooper/superDooper.xml";
@@ -41,46 +48,4 @@ public class SuperDooperDistributorParameters extends DistributorParameters {
     private String jgroupsFile = DEFAULT_SUPER_DOOPER_DISTRIBUTION_JGROUPS_FILE;
     private boolean preferIPv4Stack = DEFAULT_SUPER_DOOPER_JAVA_NET_PREFER_IPV4_STACK;
     private String jgroupsBindAddress = DEFAULT_INFINSPAN_JGROUPS_BIND_ADDRESS;
-
-    public SuperDooperDistributorParameters() {
-        super();
-    }
-
-    public String getConfigFile() {
-        return configFile;
-    }
-
-    public void setConfigFile(final String configFile) {
-        this.configFile = configFile;
-    }
-
-    public String getJgroupsFile() {
-        return jgroupsFile;
-    }
-
-    public void setJgroupsFile(final String jgroupsFile) {
-        this.jgroupsFile = jgroupsFile;
-    }
-
-    public boolean isPreferIPv4Stack() {
-        return preferIPv4Stack;
-    }
-
-    public void setPreferIPv4Stack(final boolean preferIPv4Stack) {
-        this.preferIPv4Stack = preferIPv4Stack;
-    }
-
-    public String getJgroupsBindAddress() {
-        return jgroupsBindAddress;
-    }
-
-    public void setjGroupsBindAddress(final String jgroupsBindAddress) {
-        this.jgroupsBindAddress = jgroupsBindAddress;
-    }
-
-    @Override
-    public String toString() {
-        return "SuperDooperDistributorParameters [configFile=" + configFile + ", jgroupsFile=" + jgroupsFile
-                + ", preferIPv4Stack=" + preferIPv4Stack + ", jGroupsBindAddress=" + jgroupsBindAddress + "]";
-    }
 }
index 367bf5c..5bbc121 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
  *  Modifications Copyright (C) 2019 Nordix Foundation.
+ *  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.
@@ -22,6 +23,7 @@
 package org.onap.policy.apex.service.engine.parameters.dummyclasses;
 
 import java.util.Properties;
+import lombok.Getter;
 import org.onap.policy.apex.service.engine.event.ApexEventException;
 import org.onap.policy.apex.service.engine.event.ApexEventProducer;
 import org.onap.policy.apex.service.engine.event.PeeredReference;
@@ -39,12 +41,9 @@ public class SuperDooperEventProducer implements ApexEventProducer {
 
     private static final XLogger LOGGER = XLoggerFactory.getXLogger(SuperDooperEventProducer.class);
 
+    @Getter
     private String name;
 
-    public SuperDooperEventProducer() {
-        // Default constructor
-    }
-
     /**
      * {@inheritDoc}.
      */
@@ -53,14 +52,6 @@ public class SuperDooperEventProducer implements ApexEventProducer {
         this.name = name;
     }
 
-    /**
-     * {@inheritDoc}.
-     */
-    @Override
-    public String getName() {
-        return name;
-    }
-
     /**
      * {@inheritDoc}.
      */
index 8eb1ca1..64e23f5 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
  *  Modifications Copyright (C) 2019 Nordix Foundation.
+ *  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.
@@ -21,6 +22,7 @@
 
 package org.onap.policy.apex.service.engine.parameters.dummyclasses;
 
+import lombok.Getter;
 import org.onap.policy.apex.service.engine.event.ApexEventConsumer;
 import org.onap.policy.apex.service.engine.event.ApexEventException;
 import org.onap.policy.apex.service.engine.event.ApexEventReceiver;
@@ -34,11 +36,9 @@ public class SuperDooperEventSubscriber implements ApexEventConsumer {
 
     private static final XLogger LOGGER = XLoggerFactory.getXLogger(SuperDooperEventSubscriber.class);
 
+    @Getter
     private String name;
 
-    public SuperDooperEventSubscriber() {
-    }
-
     @Override
     public void init(final String name, final EventHandlerParameters consumerParameters,
             final ApexEventReceiver apexEventReceiver) throws ApexEventException {
@@ -46,11 +46,6 @@ public class SuperDooperEventSubscriber implements ApexEventConsumer {
         LOGGER.info("Initialising Apex Consumer: " + this.getClass().getName() + ":" + this.name);
     }
 
-    @Override
-    public String getName() {
-        return name;
-    }
-
     /**
      * {@inheritDoc}.
      */
index c23da64..2342542 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2018 Ericsson. All rights reserved.
  *  Modifications Copyright (C) 2019 Nordix Foundation.
+ *  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.
@@ -31,9 +32,6 @@ import org.onap.policy.apex.core.engine.executor.exception.StateMachineException
  * Dummy state finalizer executor for testing.
  */
 public class DummyStateFinalizerExecutor extends StateFinalizerExecutor {
-    public DummyStateFinalizerExecutor() {
-        // Default constructor
-    }
 
     @Override
     public String execute(final long executionId, final Properties executorProperties,
index 01f45a5..eac2ec3 100644 (file)
@@ -3,6 +3,7 @@
  *  Copyright (C) 2018 Ericsson. All rights reserved.
  *  Modifications Copyright (C) 2019 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.
@@ -35,9 +36,6 @@ import org.onap.policy.apex.model.policymodel.concepts.AxTask;
  * Dummy task executor for testing.
  */
 public class DummyTaskExecutor extends TaskExecutor {
-    public DummyTaskExecutor() {
-        // Default constructor
-    }
 
     @Override
     public void prepare() throws StateMachineException {
index 76b5b4e..5a6a98f 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2018 Ericsson. All rights reserved.
  *  Modifications Copyright (C) 2019 Nordix Foundation.
+ *  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.
@@ -32,8 +33,6 @@ import org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey;
  * Dummy task selection executor for testing.
  */
 public class DummyTaskSelectExecutor extends TaskSelectExecutor {
-    public DummyTaskSelectExecutor() {
-    }
 
     @Override
     public void prepare() throws StateMachineException {
index 3b8394d..5004054 100644 (file)
@@ -33,6 +33,7 @@ import lombok.EqualsAndHashCode;
 import lombok.Getter;
 import lombok.Setter;
 import lombok.ToString;
+import org.apache.commons.lang3.builder.CompareToBuilder;
 import org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey;
 import org.onap.policy.apex.model.basicmodel.concepts.AxConcept;
 import org.onap.policy.apex.model.basicmodel.concepts.AxKey;
@@ -143,13 +144,9 @@ public class ArtifactKeyTestEntity extends AxConcept {
             return -1;
         }
         final ArtifactKeyTestEntity other = (ArtifactKeyTestEntity) otherObj;
-        if (key == null) {
-            if (other.key != null) {
-                return 1;
-            }
-        } else if (!key.equals(other.key)) {
-            return key.compareTo(other.key);
-        }
-        return Double.compare(doubleValue, other.doubleValue);
+        return new CompareToBuilder()
+                        .append(key, other.key)
+                        .append(doubleValue, other.doubleValue)
+                        .toComparison();
     }
 }
index da478f0..a8b90d1 100644 (file)
@@ -34,6 +34,7 @@ import lombok.EqualsAndHashCode;
 import lombok.Getter;
 import lombok.Setter;
 import lombok.ToString;
+import org.apache.commons.lang3.builder.CompareToBuilder;
 import org.onap.policy.apex.model.basicmodel.concepts.AxConcept;
 import org.onap.policy.apex.model.basicmodel.concepts.AxKey;
 import org.onap.policy.apex.model.basicmodel.concepts.AxReferenceKey;
@@ -146,13 +147,9 @@ public class ReferenceKeyTestEntity extends AxConcept {
             return -1;
         }
         final ReferenceKeyTestEntity other = (ReferenceKeyTestEntity) otherObj;
-        if (key == null) {
-            if (other.key != null) {
-                return 1;
-            }
-        } else if (!key.equals(other.key)) {
-            return key.compareTo(other.key);
-        }
-        return Double.compare(doubleValue, other.doubleValue);
+        return new CompareToBuilder()
+                        .append(key, other.key)
+                        .append(doubleValue, other.doubleValue)
+                        .toComparison();
     }
 }