[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)
|
if (userRep.getLocale() != null)
|
||||||
locale = userRep.getLocale();
|
locale = userRep.getLocale();
|
||||||
if (userRep.getUserState() != userState)
|
if (userRep.getUserState() != null)
|
||||||
userState = userRep.getUserState();
|
userState = userRep.getUserState();
|
||||||
if (!userRep.getRoles().equals(roles))
|
if (userRep.getRoles() != null && !userRep.getRoles().equals(roles))
|
||||||
roles = userRep.getRoles();
|
roles = userRep.getRoles();
|
||||||
|
|
||||||
// create new user
|
// create new user
|
||||||
|
|
|
@ -30,6 +30,7 @@ import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
||||||
|
import li.strolch.privilege.base.InvalidCredentialsException;
|
||||||
import org.junit.AfterClass;
|
import org.junit.AfterClass;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.BeforeClass;
|
import org.junit.BeforeClass;
|
||||||
|
@ -129,8 +130,8 @@ public class PrivilegeTest extends AbstractPrivilegeTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testFailAuthenticationNOk() throws Exception {
|
public void testFailAuthenticationNOk() throws Exception {
|
||||||
this.exception.expect(AccessDeniedException.class);
|
this.exception.expect(InvalidCredentialsException.class);
|
||||||
this.exception.expectMessage("User admin failed to authenticate: Password is incorrect for admin");
|
this.exception.expectMessage("Password is incorrect for admin");
|
||||||
try {
|
try {
|
||||||
login(ADMIN, ArraysHelper.copyOf(PASS_BAD));
|
login(ADMIN, ArraysHelper.copyOf(PASS_BAD));
|
||||||
} finally {
|
} finally {
|
||||||
|
@ -141,7 +142,7 @@ public class PrivilegeTest extends AbstractPrivilegeTest {
|
||||||
@Test
|
@Test
|
||||||
public void testFailAuthenticationPWNull() throws Exception {
|
public void testFailAuthenticationPWNull() throws Exception {
|
||||||
this.exception.expect(PrivilegeException.class);
|
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 {
|
try {
|
||||||
login(ADMIN, null);
|
login(ADMIN, null);
|
||||||
} finally {
|
} finally {
|
||||||
|
|
Loading…
Reference in New Issue