コード例 #1
0
  @Test
  public void testGetUserById() {
    // GIVEN
    when(userDao.findOne(anyLong())).thenReturn(this.mockUser);

    // WHEN
    User tmpUser = userService.getUserById(Long.valueOf(1));

    // THEN
    assertEquals(tmpUser, this.mockUser);
  }
コード例 #2
0
 @Test(expected = AssertionError.class)
 public void testGetUserByIdNull() {
   userService.getUserById(null);
 }