3 import static org.junit.Assert.*;
4 import static org.hamcrest.core.Is.*;
8 import javax.persistence.EntityManager;
9 import javax.persistence.EntityTransaction;
10 import javax.persistence.Persistence;
12 import org.junit.After;
13 import org.junit.Before;
14 import org.junit.Test;
16 import dependent.DependentEntity;
18 public class MainEntityTest {
20 private EntityManager em;
21 private EntityTransaction transaction;
24 public void initializeDependencies() {
25 em = Persistence.createEntityManagerFactory("jpaIntegrationTest")
26 .createEntityManager();
27 transaction = em.getTransaction();
30 @SuppressWarnings({ "rawtypes" })
33 DependentEntity entity = new DependentEntity();
39 List resultList = em.createNativeQuery(
40 "select * from dependententity_aud").getResultList();
41 assertThat(resultList.size(), is(1));