Also added lombok to test classes.
Issue-ID: POLICY-3391
Change-Id: I9ecf479f3861a2e5211b037e885029d1719b6a56
Signed-off-by: Jim Hahn <jrh3@att.com>
/*-
* ============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;
public class DummyStErrorListener implements STErrorListener {
/** Counts errors of the listener. */
+ @Getter(AccessLevel.PROTECTED)
+ @Setter(AccessLevel.PROTECTED)
private int errorCount;
/**
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;
- }
}
/*-
* ============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.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;
*
* @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.
*
/*-
* ============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";
/*-
* ============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;
- }
}
* ============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.
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;
}
* 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.
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;
/**
* 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) {
* ============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.
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;
/**
* 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) {
return new AxArtifactKey("task" + (taskNo++) + ":0.0.1");
}
- public void setTaskNo(int incomingTaskNo) {
- taskNo = incomingTaskNo;
- }
-
/**
* {@inheritDoc}.
*/
* 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.
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");
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");
.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);
/*-
* ============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=========================================================
*/
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;
/**
* 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}.
*/
public void clear() {
throw new NotImplementedException("Not implemented on dummy class");
}
-
+
/**
* {@inheritDoc}.
*/
* ============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;
- }
}
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;
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());
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;
*
* @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.
*
* ============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.
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;
*
* @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.
*
resultEvents.add(actionEvent);
}
}
-
- /**
- * Gets the id.
- *
- * @return the id
- */
- public String getId() {
- return id;
- }
}
* ============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.
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;
*
* @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.
*
resultEvents.add(saleauthEvent);
}
}
-
- /**
- * Gets the id.
- *
- * @return the id
- */
- public String getId() {
- return id;
- }
}
* ============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.
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;
* Support Apex event reveiver for unit test.
*
*/
+@Getter
public class SupportApexEventReceiver implements ApexEventReceiver {
private long lastExecutionId;
private Object lastEvent;
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;
- }
}
/*-
* ============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.
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;
* Support Apex event reveiver for unit test.
*
*/
+@Getter
public class SupportApexEventReceiver implements ApexEventReceiver {
private long lastExecutionId;
private Object lastEvent;
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;
- }
}
/*-
* ============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;
/**
System.out.println(xmlEvents(eventCount));
}
-
- /**
- * Gets the next event no.
- *
- * @return the next event no
- */
- public static int getNextEventNo() {
- return nextEventNo;
- }
}
/*-
* ============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.
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;
*/
@Entity
@Table(name = "ArtifactKeyTestEntity")
+@Getter
+@Setter
+@ToString
+@EqualsAndHashCode(callSuper = false)
public class ArtifactKeyTestEntity extends AxConcept {
private static final long serialVersionUID = -2962570563281067896L;
this.doubleValue = doubleValue;
}
- /**
- * {@inheritDoc}.
- */
- @Override
- public AxArtifactKey getKey() {
- return key;
- }
-
/**
* {@inheritDoc}.
*/
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.
*
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}.
*/
key.clean();
}
- /**
- * {@inheritDoc}.
- */
- @Override
- public String toString() {
- return "ArtifactKeyTestEntity [key=" + key + ", doubleValue=" + doubleValue + "]";
- }
-
/**
* {@inheritDoc}.
*/
}
}
- /**
- * {@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}.
*/
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();
}
}
/*-
* ============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.
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;
*/
@Entity
@Table(name = "ReferenceKeyTestEntity")
+@Getter
+@Setter
+@ToString
+@EqualsAndHashCode(callSuper = false)
public class ReferenceKeyTestEntity extends AxConcept {
private static final long serialVersionUID = -2962570563281067895L;
this.doubleValue = doubleValue;
}
- /**
- * {@inheritDoc}.
- */
- @Override
- public AxReferenceKey getKey() {
- return key;
- }
-
/**
* {@inheritDoc}.
*/
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.
*
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}.
*/
key.clean();
}
- /**
- * {@inheritDoc}.
- */
- @Override
- public String toString() {
- return "ReferenceKeyTestEntity [key=" + key + ", doubleValue=" + doubleValue + "]";
- }
-
/**
* {@inheritDoc}.
*/
}
}
- /**
- * {@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}.
*/
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();
}
}
/*-
* ============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;
}
/*-
* ============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;
- }
}
/*-
* ============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;
}
/*-
* ============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;
- }
}
/*-
* ============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.
* 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,
* ============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.
* Dummy task executor for testing.
*/
public class DummyTaskExecutor extends TaskExecutor {
- public DummyTaskExecutor() {
- // Default constructor
- }
@Override
public void prepare() throws StateMachineException {
/*-
* ============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.
* Dummy task selection executor for testing.
*/
public class DummyTaskSelectExecutor extends TaskSelectExecutor {
- public DummyTaskSelectExecutor() {
- }
@Override
public void prepare() throws StateMachineException {
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;
*/
@NotNull
@NotBlank
+@Getter
+@Setter
public class SuperDooperCarrierTechnologyParameters extends CarrierTechnologyParameters {
// Default parameter values
private static final String DEFAULT_ACKS = "all";
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.
*
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}.
*/
/*-
* ============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";
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 + "]";
- }
}
* ============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.
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;
private static final XLogger LOGGER = XLoggerFactory.getXLogger(SuperDooperEventProducer.class);
+ @Getter
private String name;
- public SuperDooperEventProducer() {
- // Default constructor
- }
-
/**
* {@inheritDoc}.
*/
this.name = name;
}
- /**
- * {@inheritDoc}.
- */
- @Override
- public String getName() {
- return name;
- }
-
/**
* {@inheritDoc}.
*/
* ============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.
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;
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 {
LOGGER.info("Initialising Apex Consumer: " + this.getClass().getName() + ":" + this.name);
}
- @Override
- public String getName() {
- return name;
- }
-
/**
* {@inheritDoc}.
*/
* ============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.
* 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,
* 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.
* Dummy task executor for testing.
*/
public class DummyTaskExecutor extends TaskExecutor {
- public DummyTaskExecutor() {
- // Default constructor
- }
@Override
public void prepare() throws StateMachineException {
* ============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.
* Dummy task selection executor for testing.
*/
public class DummyTaskSelectExecutor extends TaskSelectExecutor {
- public DummyTaskSelectExecutor() {
- }
@Override
public void prepare() throws StateMachineException {
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;
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();
}
}
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;
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();
}
}