aboutsummaryrefslogtreecommitdiffstats
path: root/applications/common/src/test
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2020-05-29 11:43:49 -0400
committerJim Hahn <jrh3@att.com>2020-06-01 10:06:25 -0400
commit3c703e2e48c0e74cb580b8afafb212fb9728aeeb (patch)
tree70b0aa73da0949457998b4101547026e39060740 /applications/common/src/test
parent9213cdfc854115fb427ca22c1d04f2b3051f806f (diff)
Use OperationsHistory from models
Deleted Dbao and replaced it with the shared class in policy-models. Also had to update the queries and the persistence.xml accordingly. Issue-ID: POLICY-2581 Change-Id: I59dfa2f37c272796ccebc0f578c9f4e8e1b9c8ab Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'applications/common/src/test')
-rw-r--r--applications/common/src/test/java/org/onap/policy/pdp/xacml/application/common/operationshistory/CountRecentOperationsPipTest.java11
-rw-r--r--applications/common/src/test/java/org/onap/policy/pdp/xacml/application/common/operationshistory/GetOperationOutcomePipTest.java3
-rw-r--r--applications/common/src/test/resources/META-INF/persistence.xml5
3 files changed, 10 insertions, 9 deletions
diff --git a/applications/common/src/test/java/org/onap/policy/pdp/xacml/application/common/operationshistory/CountRecentOperationsPipTest.java b/applications/common/src/test/java/org/onap/policy/pdp/xacml/application/common/operationshistory/CountRecentOperationsPipTest.java
index 29eb2a0c..badc5f9c 100644
--- a/applications/common/src/test/java/org/onap/policy/pdp/xacml/application/common/operationshistory/CountRecentOperationsPipTest.java
+++ b/applications/common/src/test/java/org/onap/policy/pdp/xacml/application/common/operationshistory/CountRecentOperationsPipTest.java
@@ -51,6 +51,7 @@ import org.junit.BeforeClass;
import org.junit.Test;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
+import org.onap.policy.guard.OperationsHistory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -216,7 +217,7 @@ public class CountRecentOperationsPipTest {
//
// create entry
//
- Dbao newEntry = createEntry("cl-foobar-1", "vnf-1", "SUCCESS");
+ OperationsHistory newEntry = createEntry("cl-foobar-1", "vnf-1", "SUCCESS");
//
// No entries yet
//
@@ -241,7 +242,7 @@ public class CountRecentOperationsPipTest {
@Test
public void testStringToChronoUnit() throws PIPException {
// not configured yet
- Dbao newEntry = createEntry("cl-foobar-1", "vnf-1", "SUCCESS");
+ OperationsHistory newEntry = createEntry("cl-foobar-1", "vnf-1", "SUCCESS");
assertEquals(-1, getCount(newEntry));
// now configure it
@@ -266,7 +267,7 @@ public class CountRecentOperationsPipTest {
assertEquals(-1, getCount(newEntry));
}
- private long getCount(Dbao newEntry) throws PIPException {
+ private long getCount(OperationsHistory newEntry) throws PIPException {
responses = new LinkedList<>(Arrays.asList(resp1, resp2, resp3));
attributes = new LinkedList<>(
Arrays.asList(newEntry.getActor(), newEntry.getOperation(), newEntry.getTarget()));
@@ -279,11 +280,11 @@ public class CountRecentOperationsPipTest {
return ((Number) value.getValue()).longValue();
}
- private Dbao createEntry(String cl, String target, String outcome) {
+ private OperationsHistory createEntry(String cl, String target, String outcome) {
//
// Create entry
//
- Dbao newEntry = new Dbao();
+ OperationsHistory newEntry = new OperationsHistory();
newEntry.setClosedLoopName(cl);
newEntry.setTarget(target);
newEntry.setOutcome(outcome);
diff --git a/applications/common/src/test/java/org/onap/policy/pdp/xacml/application/common/operationshistory/GetOperationOutcomePipTest.java b/applications/common/src/test/java/org/onap/policy/pdp/xacml/application/common/operationshistory/GetOperationOutcomePipTest.java
index b5273e6d..dd961d8c 100644
--- a/applications/common/src/test/java/org/onap/policy/pdp/xacml/application/common/operationshistory/GetOperationOutcomePipTest.java
+++ b/applications/common/src/test/java/org/onap/policy/pdp/xacml/application/common/operationshistory/GetOperationOutcomePipTest.java
@@ -47,6 +47,7 @@ import org.junit.BeforeClass;
import org.junit.Test;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
+import org.onap.policy.guard.OperationsHistory;
import org.onap.policy.pdp.xacml.application.common.ToscaDictionary;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -234,7 +235,7 @@ public class GetOperationOutcomePipTest {
//
// Create entry
//
- Dbao newEntry = new Dbao();
+ OperationsHistory newEntry = new OperationsHistory();
newEntry.setClosedLoopName(cl);
newEntry.setTarget(target);
newEntry.setOutcome(outcome);
diff --git a/applications/common/src/test/resources/META-INF/persistence.xml b/applications/common/src/test/resources/META-INF/persistence.xml
index d917c06b..a0f0d45d 100644
--- a/applications/common/src/test/resources/META-INF/persistence.xml
+++ b/applications/common/src/test/resources/META-INF/persistence.xml
@@ -3,7 +3,7 @@
============LICENSE_START=======================================================
ONAP
================================================================================
- Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ Copyright (C) 2019-2020 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,8 +23,7 @@
<persistence-unit name="PipEngineTest" transaction-type="RESOURCE_LOCAL">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
-
- <class>org.onap.policy.pdp.xacml.application.common.operationshistory.Dbao</class>
+ <class>org.onap.policy.guard.OperationsHistory</class>
<properties>
<property name="eclipselink.ddl-generation" value="create-tables" />