summaryrefslogtreecommitdiffstats
path: root/BRMSGateway/src/test/java
diff options
context:
space:
mode:
Diffstat (limited to 'BRMSGateway/src/test/java')
-rw-r--r--BRMSGateway/src/test/java/org/onap/policy/brms/api/BrmsHandlerTest.java5
-rw-r--r--BRMSGateway/src/test/java/org/onap/policy/brms/api/BrmsPushTest.java6
2 files changed, 6 insertions, 5 deletions
diff --git a/BRMSGateway/src/test/java/org/onap/policy/brms/api/BrmsHandlerTest.java b/BRMSGateway/src/test/java/org/onap/policy/brms/api/BrmsHandlerTest.java
index 58bacef13..1a6dc4719 100644
--- a/BRMSGateway/src/test/java/org/onap/policy/brms/api/BrmsHandlerTest.java
+++ b/BRMSGateway/src/test/java/org/onap/policy/brms/api/BrmsHandlerTest.java
@@ -30,6 +30,7 @@ import javax.persistence.EntityManagerFactory;
import javax.persistence.EntityTransaction;
import javax.persistence.Persistence;
import javax.persistence.Query;
+import javax.persistence.TypedQuery;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -54,8 +55,8 @@ public class BrmsHandlerTest {
PowerMockito.when(Persistence.createEntityManagerFactory(any(), any())).thenReturn(emf);
final EntityTransaction et = Mockito.mock(EntityTransaction.class);
Mockito.when(em.getTransaction()).thenReturn(et);
- final Query query = Mockito.mock(Query.class);
- Mockito.when(em.createQuery(Mockito.anyString())).thenReturn(query);
+ final TypedQuery<?> query = Mockito.mock(TypedQuery.class);
+ Mockito.when(em.createQuery(Mockito.anyString(), Mockito.any())).thenReturn((TypedQuery<Object>) query);
// Mock backup monitor
PowerMockito.mockStatic(BackUpMonitor.class);
diff --git a/BRMSGateway/src/test/java/org/onap/policy/brms/api/BrmsPushTest.java b/BRMSGateway/src/test/java/org/onap/policy/brms/api/BrmsPushTest.java
index 2b13640d2..2c76a2eff 100644
--- a/BRMSGateway/src/test/java/org/onap/policy/brms/api/BrmsPushTest.java
+++ b/BRMSGateway/src/test/java/org/onap/policy/brms/api/BrmsPushTest.java
@@ -33,7 +33,7 @@ import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.EntityTransaction;
import javax.persistence.Persistence;
-import javax.persistence.Query;
+import javax.persistence.TypedQuery;
import org.apache.maven.model.Dependency;
import org.junit.Rule;
@@ -65,8 +65,8 @@ public class BrmsPushTest {
PowerMockito.when(Persistence.createEntityManagerFactory(Mockito.any(), Mockito.any())).thenReturn(emf);
final EntityTransaction et = Mockito.mock(EntityTransaction.class);
Mockito.when(em.getTransaction()).thenReturn(et);
- final Query query = Mockito.mock(Query.class);
- Mockito.when(em.createQuery(Mockito.anyString())).thenReturn(query);
+ final TypedQuery<?> query = Mockito.mock(TypedQuery.class);
+ Mockito.when(em.createQuery(Mockito.anyString(), Mockito.any())).thenReturn((TypedQuery<Object>) query);
// Mock backup monitor
PowerMockito.mockStatic(BackUpMonitor.class);