Clean up created test user to avoid conflict with other tests
Closes #23804
This commit is contained in:
parent
7dda393120
commit
50916d58b1
2 changed files with 7 additions and 1 deletions
|
@ -51,6 +51,9 @@ public class SerializationUtil {
|
||||||
oos.close();
|
oos.close();
|
||||||
|
|
||||||
return "EXCEPTION:" + Base64.encodeBytes(os.toByteArray());
|
return "EXCEPTION:" + Base64.encodeBytes(os.toByteArray());
|
||||||
|
} catch (NotSerializableException e) {
|
||||||
|
// when the exception can't be serialized, at least log the original exception, so it can be analyzed
|
||||||
|
throw new RuntimeException("Unable to serialize exception due to not serializable class " + e.getMessage(), t);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
|
|
|
@ -167,7 +167,7 @@ public class LDAPProvidersFullNameMapperTest extends AbstractLDAPTest {
|
||||||
MatcherAssert.assertThat(Arrays.asList("one", "two", "three"),
|
MatcherAssert.assertThat(Arrays.asList("one", "two", "three"),
|
||||||
Matchers.containsInAnyOrder(fullnameUser.getAttributeStream("myAttrThreeValues").toArray(String[]::new)));
|
Matchers.containsInAnyOrder(fullnameUser.getAttributeStream("myAttrThreeValues").toArray(String[]::new)));
|
||||||
|
|
||||||
// Remove "fullnameUser" to assert he is removed from LDAP.
|
// Remove "fullnameUser" to prevent conflicts with other tests
|
||||||
session.users().removeUser(appRealm, fullnameUser);
|
session.users().removeUser(appRealm, fullnameUser);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -201,6 +201,9 @@ public class LDAPProvidersFullNameMapperTest extends AbstractLDAPTest {
|
||||||
|
|
||||||
UserModel fullnameUser = session.users().getUserByUsername(appRealm, "fullname");
|
UserModel fullnameUser = session.users().getUserByUsername(appRealm, "fullname");
|
||||||
Assert.assertEquals(Arrays.asList("role1", "role2"), fullnameUser.getAttributeStream("roles").collect(Collectors.toList()));
|
Assert.assertEquals(Arrays.asList("role1", "role2"), fullnameUser.getAttributeStream("roles").collect(Collectors.toList()));
|
||||||
|
|
||||||
|
// Remove "fullnameUser" to prevent conflicts with other tests
|
||||||
|
session.users().removeUser(appRealm, fullnameUser);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue