summaryrefslogtreecommitdiffstats
path: root/controlloop/m2/base/src/test
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2020-06-25 11:12:36 -0400
committerJim Hahn <jrh3@att.com>2020-06-25 11:57:00 -0400
commit069dbb206cedae6c664972cfb8baf036989d61a0 (patch)
treee0a2f0edd840775000c947811157ac81cb719981 /controlloop/m2/base/src/test
parent68cdd3fe41fe7fa101d0d2331bd493a67e16203f (diff)
Use parent snapshot in drools-apps
Fixed checkstyle issues that were subsequently reported. Also fixed a few eclipse warnings. Also fixed some of the sonar issues in the files that were touched: - use "{}" in logger calls - camelcase method names - use "<?>" instead of generics - add serialization ID Issue-ID: POLICY-2188 Change-Id: I5c94a2e26dd74a61a0a919e1c3da17ab02a5bc9d Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'controlloop/m2/base/src/test')
-rw-r--r--controlloop/m2/base/src/test/java/org/onap/policy/m2/base/ActorOperationTest.java2
-rw-r--r--controlloop/m2/base/src/test/java/org/onap/policy/m2/base/GuardAdjunctTest.java6
-rw-r--r--controlloop/m2/base/src/test/java/org/onap/policy/m2/base/TransactionTest.java8
3 files changed, 5 insertions, 11 deletions
diff --git a/controlloop/m2/base/src/test/java/org/onap/policy/m2/base/ActorOperationTest.java b/controlloop/m2/base/src/test/java/org/onap/policy/m2/base/ActorOperationTest.java
index ce5f2df1f..33b4928b1 100644
--- a/controlloop/m2/base/src/test/java/org/onap/policy/m2/base/ActorOperationTest.java
+++ b/controlloop/m2/base/src/test/java/org/onap/policy/m2/base/ActorOperationTest.java
@@ -25,7 +25,6 @@ import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import org.junit.Test;
-
import org.onap.policy.controlloop.ControlLoopEvent;
import org.onap.policy.controlloop.ControlLoopException;
import org.onap.policy.controlloop.policy.Policy;
@@ -37,6 +36,7 @@ public class ActorOperationTest {
public static final String STATE = "COMPLETE";
public static class TestOperation implements Operation {
+ private static final long serialVersionUID = 1L;
@Override
public Object getRequest() throws ControlLoopException {
diff --git a/controlloop/m2/base/src/test/java/org/onap/policy/m2/base/GuardAdjunctTest.java b/controlloop/m2/base/src/test/java/org/onap/policy/m2/base/GuardAdjunctTest.java
index 78aab89d4..facde545a 100644
--- a/controlloop/m2/base/src/test/java/org/onap/policy/m2/base/GuardAdjunctTest.java
+++ b/controlloop/m2/base/src/test/java/org/onap/policy/m2/base/GuardAdjunctTest.java
@@ -26,14 +26,11 @@ import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
import java.time.Instant;
import java.util.UUID;
-
import org.junit.BeforeClass;
import org.junit.Test;
-
import org.onap.policy.controlloop.ControlLoopOperation;
import org.onap.policy.controlloop.policy.Policy;
import org.onap.policy.guard.GuardContext;
@@ -41,7 +38,6 @@ import org.powermock.reflect.Whitebox;
public class GuardAdjunctTest {
private static final String ADJUNCT_CONTEXT_FIELD = "context";
- private static final String ADJUNCT_TRANSACTION_FIELD = "transaction";
private static GuardAdjunct adjunct;
private static Transaction transaction;
@@ -73,7 +69,7 @@ public class GuardAdjunctTest {
assertTrue(adjunct.asyncQuery(policy, "testTarget", UUID.randomUUID().toString()));
GuardContext savedContext = Whitebox.getInternalState(adjunct, ADJUNCT_CONTEXT_FIELD);
- Whitebox.setInternalState(adjunct, ADJUNCT_CONTEXT_FIELD, (GuardContext)null);
+ Whitebox.setInternalState(adjunct, ADJUNCT_CONTEXT_FIELD, (GuardContext) null);
try {
assertFalse(adjunct.asyncQuery(policy, "testTarget", UUID.randomUUID().toString()));
diff --git a/controlloop/m2/base/src/test/java/org/onap/policy/m2/base/TransactionTest.java b/controlloop/m2/base/src/test/java/org/onap/policy/m2/base/TransactionTest.java
index 30546d0ec..c5fa6befd 100644
--- a/controlloop/m2/base/src/test/java/org/onap/policy/m2/base/TransactionTest.java
+++ b/controlloop/m2/base/src/test/java/org/onap/policy/m2/base/TransactionTest.java
@@ -25,14 +25,13 @@ import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
-import static org.mockito.Matchers.anyObject;
+import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import java.time.Instant;
import java.util.LinkedList;
import java.util.UUID;
-
import org.drools.core.WorkingMemory;
import org.drools.core.impl.StatefulKnowledgeSessionImpl;
import org.junit.BeforeClass;
@@ -46,7 +45,6 @@ import org.onap.policy.controlloop.policy.ControlLoopPolicy;
import org.onap.policy.controlloop.policy.FinalResult;
import org.onap.policy.controlloop.policy.Policy;
import org.onap.policy.controlloop.policy.Target;
-import org.onap.policy.m2.base.GuardAdjunct;
public class TransactionTest {
@@ -61,7 +59,7 @@ public class TransactionTest {
public static void setUpBeforeClass() {
mockWorkingMemory = mock(WorkingMemory.class);
FactHandle factHandle = mock(FactHandle.class);
- when(mockWorkingMemory.getFactHandle(anyObject())).thenReturn(factHandle);
+ when(mockWorkingMemory.getFactHandle(any())).thenReturn(factHandle);
}
@Test
@@ -310,7 +308,7 @@ public class TransactionTest {
Transaction transaction = new Transaction(mockWorkingMemory, CL_NAME, UUID.randomUUID(), createControlLoop());
ControlLoopNotification notification = transaction.processError();
assertNull(notification);
-
+
VirtualControlLoopEvent onset =
createControlLoopEvent(UUID.randomUUID(), CL_NAME, null, "VM", "vserver.vserver-name");
transaction.setControlLoopEvent(onset);