use of org.keycloak.partialimport.PartialImportResults in project keycloak by keycloak.
the class PartialImportTest method testSkip.
private void testSkip() {
setSkip();
PartialImportResults results = doImport();
assertEquals(NUM_ENTITIES, results.getAdded());
results = doImport();
assertEquals(NUM_ENTITIES, results.getSkipped());
}
use of org.keycloak.partialimport.PartialImportResults in project keycloak by keycloak.
the class PartialImportTest method testAddProviders.
@Test
public void testAddProviders() {
setFail();
addProviders();
PartialImportResults results = doImport();
assertEquals(IDP_ALIASES.length, results.getAdded());
for (PartialImportResult result : results.getResults()) {
String id = result.getId();
IdentityProviderResource idpRsc = testRealmResource().identityProviders().get(id);
IdentityProviderRepresentation idp = idpRsc.toRepresentation();
Map<String, String> config = idp.getConfig();
assertTrue(Arrays.asList(IDP_ALIASES).contains(config.get("clientId")));
}
}
use of org.keycloak.partialimport.PartialImportResults in project keycloak by keycloak.
the class PartialImportTest method testEverythingOverwrite.
@Test
public void testEverythingOverwrite() throws IOException {
setOverwrite();
importEverything(false);
PartialImportResults results = doImport();
assertEquals(NUM_ENTITIES * NUM_RESOURCE_TYPES, results.getOverwritten());
}
use of org.keycloak.partialimport.PartialImportResults in project keycloak by keycloak.
the class PartialImportTest method testFail.
private void testFail() {
setFail();
PartialImportResults results = doImport();
assertNull(results.getErrorMessage());
// second time should fail
results = doImport();
assertNotNull(results.getErrorMessage());
}
use of org.keycloak.partialimport.PartialImportResults in project keycloak by keycloak.
the class PartialImportTest method testAddClientsOverwriteWithServiceAccountsAndAuthorization.
@EnableFeature(value = UPLOAD_SCRIPTS, skipRestart = true)
@Test
public void testAddClientsOverwriteWithServiceAccountsAndAuthorization() throws IOException {
addClients(true);
setOverwrite();
PartialImportResults results = doImport();
assertEquals(NUM_ENTITIES * 2, results.getAdded());
results = doImport();
assertEquals(NUM_ENTITIES * 2, results.getOverwritten());
}
Aggregations