[KEYCLOAK-8779] - Fixing PartialImportTest

This commit is contained in:
Pedro Igor 2019-12-27 16:21:34 -03:00
parent 401d36b446
commit 56d53b191a

View file

@ -41,6 +41,7 @@ import org.keycloak.representations.idm.UserRepresentation;
import org.keycloak.testsuite.AbstractAuthTest; import org.keycloak.testsuite.AbstractAuthTest;
import org.keycloak.testsuite.Assert; import org.keycloak.testsuite.Assert;
import org.keycloak.testsuite.admin.ApiUtil; import org.keycloak.testsuite.admin.ApiUtil;
import org.keycloak.testsuite.arquillian.annotation.EnableFeature;
import org.keycloak.testsuite.util.AssertAdminEvents; import org.keycloak.testsuite.util.AssertAdminEvents;
import org.keycloak.testsuite.util.RealmBuilder; import org.keycloak.testsuite.util.RealmBuilder;
@ -61,6 +62,8 @@ import org.keycloak.admin.client.resource.AuthorizationResource;
import org.keycloak.common.constants.ServiceAccountConstants; import org.keycloak.common.constants.ServiceAccountConstants;
import org.keycloak.partialimport.ResourceType; import org.keycloak.partialimport.ResourceType;
import org.keycloak.representations.idm.authorization.ResourceServerRepresentation; import org.keycloak.representations.idm.authorization.ResourceServerRepresentation;
import static org.keycloak.common.Profile.Feature.UPLOAD_SCRIPTS;
import static org.keycloak.testsuite.auth.page.AuthRealm.MASTER; import static org.keycloak.testsuite.auth.page.AuthRealm.MASTER;
import org.keycloak.util.JsonSerialization; import org.keycloak.util.JsonSerialization;
@ -442,6 +445,7 @@ public class PartialImportTest extends AbstractAuthTest {
} }
} }
@EnableFeature(value = UPLOAD_SCRIPTS, skipRestart = true)
@Test @Test
public void testAddClientsWithServiceAccountsAndAuthorization() throws IOException { public void testAddClientsWithServiceAccountsAndAuthorization() throws IOException {
setFail(); setFail();
@ -591,6 +595,7 @@ public class PartialImportTest extends AbstractAuthTest {
testSkip(); testSkip();
} }
@EnableFeature(value = UPLOAD_SCRIPTS, skipRestart = true)
@Test @Test
public void testAddClientsSkipWithServiceAccountsAndAuthorization() throws IOException { public void testAddClientsSkipWithServiceAccountsAndAuthorization() throws IOException {
addClients(true); addClients(true);
@ -647,6 +652,7 @@ public class PartialImportTest extends AbstractAuthTest {
testOverwrite(); testOverwrite();
} }
@EnableFeature(value = UPLOAD_SCRIPTS, skipRestart = true)
@Test @Test
public void testAddClientsOverwriteWithServiceAccountsAndAuthorization() throws IOException { public void testAddClientsOverwriteWithServiceAccountsAndAuthorization() throws IOException {
addClients(true); addClients(true);
@ -658,6 +664,7 @@ public class PartialImportTest extends AbstractAuthTest {
assertEquals(NUM_ENTITIES * 2, results.getOverwritten()); assertEquals(NUM_ENTITIES * 2, results.getOverwritten());
} }
@EnableFeature(value = UPLOAD_SCRIPTS, skipRestart = true)
@Test @Test
public void testAddClientsOverwriteServiceAccountsWithNoServiceAccounts() throws IOException { public void testAddClientsOverwriteServiceAccountsWithNoServiceAccounts() throws IOException {
addClients(true); addClients(true);
@ -733,6 +740,7 @@ public class PartialImportTest extends AbstractAuthTest {
assertEquals(NUM_ENTITIES * NUM_RESOURCE_TYPES, results.getSkipped()); assertEquals(NUM_ENTITIES * NUM_RESOURCE_TYPES, results.getSkipped());
} }
@EnableFeature(value = UPLOAD_SCRIPTS, skipRestart = true)
@Test @Test
public void testEverythingSkipWithServiceAccounts() throws IOException { public void testEverythingSkipWithServiceAccounts() throws IOException {
setSkip(); setSkip();
@ -749,6 +757,7 @@ public class PartialImportTest extends AbstractAuthTest {
assertEquals(NUM_ENTITIES * NUM_RESOURCE_TYPES, results.getOverwritten()); assertEquals(NUM_ENTITIES * NUM_RESOURCE_TYPES, results.getOverwritten());
} }
@EnableFeature(value = UPLOAD_SCRIPTS, skipRestart = true)
@Test @Test
public void testEverythingOverwriteWithServiceAccounts() throws IOException { public void testEverythingOverwriteWithServiceAccounts() throws IOException {
setOverwrite(); setOverwrite();