예제 #1
0
  @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();
  }
예제 #2
0
 final Role configureGet(final long id) {
   final Role entity = createNewEntity();
   entity.setId(id);
   when(daoMock.findOne(id)).thenReturn(entity);
   return entity;
 }