@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); }
@Test(expected = AssertionError.class) public void testGetUserByIdNull() { userService.getUserById(null); }