@Override @Before public final void before() { instance = new RoleServiceImpl(); daoMock = mock(IRoleJpaDAO.class); when(daoMock.save(any(Role.class))).thenReturn(new Role()); when(daoMock.findAll()).thenReturn(Lists.<Role>newArrayList()); instance.dao = daoMock; super.before(); }
final Role configureGet(final long id) { final Role entity = createNewEntity(); entity.setId(id); when(daoMock.findOne(id)).thenReturn(entity); return entity; }