I am trying out a simple test case, But I get an exception java.lang.IllegalArgumentException: Entity not managed. Can somebody give me a test case to test how the refresh() of entitymanager works
//get username User user = ObjectManager.findById(2L); //make dirty user.setUsername("xyz"); //undo dirty changes ObjectManager.refresh(user); assertEquals(eventLog.getUsername(), "john");
Also for the contains() method of the entityManager. It always returns false. I have tried getReference() and then check using contains() but again false.
|