@Test(expected = AssertionError.class) public void testGetNullUserByPrincipal() { // GIVEN when(userDao.findByEmail(anyString())).thenReturn(null); // WHEN userService.getUserByPrincipal(this.mockAuthUser); }
@Test public void testGetUserByPrincipal() { // GIVEN when(userDao.findByEmail(anyString())).thenReturn(this.mockUser); // WHEN User tmpUser = userService.getUserByPrincipal(this.mockAuthUser); // THEN assertEquals(tmpUser, this.mockUser); }