use of org.keycloak.representations.idm.SynchronizationResultRepresentation in project keycloak by keycloak.
the class LDAPSyncTest method test07SyncRestAPIWrongAction.
// KEYCLOAK-10770 user-storage/{id}/sync should return 400 instead of 404
@Test
public void test07SyncRestAPIWrongAction() {
ComponentRepresentation ldapRep = testRealm().components().component(ldapModelId).toRepresentation();
try {
SynchronizationResultRepresentation syncResultRep = adminClient.realm("test").userStorage().syncUsers(ldapModelId, "wrong action");
Assert.fail("Should throw 400");
} catch (Exception e) {
Assert.assertTrue(e instanceof BadRequestException);
}
}
use of org.keycloak.representations.idm.SynchronizationResultRepresentation in project keycloak by keycloak.
the class LDAPSyncTest method test06SyncRestAPIMissingAction.
// KEYCLOAK-10770 user-storage/{id}/sync should return 400 instead of 404
@Test
public void test06SyncRestAPIMissingAction() {
ComponentRepresentation ldapRep = testRealm().components().component(ldapModelId).toRepresentation();
try {
SynchronizationResultRepresentation syncResultRep = adminClient.realm("test").userStorage().syncUsers(ldapModelId, null);
Assert.fail("Should throw 400");
} catch (Exception e) {
Assert.assertTrue(e instanceof BadRequestException);
}
}
use of org.keycloak.representations.idm.SynchronizationResultRepresentation in project keycloak by keycloak.
the class LDAPGroupMapperSyncTest method test05SyncRestAPI.
@Test
public void test05SyncRestAPI() {
ComponentRepresentation groupMapperRep = findMapperRepByName("groupsMapper");
try {
// testing KEYCLOAK-3980 which threw an NPE because I was looking up the factory wrong.
SynchronizationResultRepresentation syncResultRep = adminClient.realm("test").userStorage().syncMapperData(ldapModelId, groupMapperRep.getId(), "error");
Assert.fail("Should throw 400");
} catch (BadRequestException e) {
}
}
Aggregations