[Fix] Fixed broken tests
This commit is contained in:
parent
b9df4fb02a
commit
6faebf278d
|
@ -549,9 +549,9 @@ public class DefaultPrivilegeHandler implements PrivilegeHandler {
|
|||
|
||||
if (userRep.getLocale() != null)
|
||||
locale = userRep.getLocale();
|
||||
if (userRep.getUserState() != userState)
|
||||
if (userRep.getUserState() != null)
|
||||
userState = userRep.getUserState();
|
||||
if (!userRep.getRoles().equals(roles))
|
||||
if (userRep.getRoles() != null && !userRep.getRoles().equals(roles))
|
||||
roles = userRep.getRoles();
|
||||
|
||||
// create new user
|
||||
|
|
|
@ -30,6 +30,7 @@ import java.util.HashSet;
|
|||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import li.strolch.privilege.base.InvalidCredentialsException;
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.Before;
|
||||
import org.junit.BeforeClass;
|
||||
|
@ -129,8 +130,8 @@ public class PrivilegeTest extends AbstractPrivilegeTest {
|
|||
|
||||
@Test
|
||||
public void testFailAuthenticationNOk() throws Exception {
|
||||
this.exception.expect(AccessDeniedException.class);
|
||||
this.exception.expectMessage("User admin failed to authenticate: Password is incorrect for admin");
|
||||
this.exception.expect(InvalidCredentialsException.class);
|
||||
this.exception.expectMessage("Password is incorrect for admin");
|
||||
try {
|
||||
login(ADMIN, ArraysHelper.copyOf(PASS_BAD));
|
||||
} finally {
|
||||
|
@ -141,7 +142,7 @@ public class PrivilegeTest extends AbstractPrivilegeTest {
|
|||
@Test
|
||||
public void testFailAuthenticationPWNull() throws Exception {
|
||||
this.exception.expect(PrivilegeException.class);
|
||||
this.exception.expectMessage("User admin failed to authenticate: A password may not be empty!");
|
||||
this.exception.expectMessage("A password may not be empty!");
|
||||
try {
|
||||
login(ADMIN, null);
|
||||
} finally {
|
||||
|
|
Loading…
Reference in New Issue