I am new to the jpa and spring world and I am currently doing some unit test on a simple method but keep getting this error message only when I run my test class in unit tes
I think EntityManager is null.Try Like this,may be it work
private EntityManager entityManager = null; @PersistenceContext public void setEntityManager(EntityManager entityManager) { this.entityManager = entityManager; }