[KEYCLOAK-8185] add clear method to exportimport resource

This commit is contained in:
wyvie 2018-09-12 08:35:39 +02:00 committed by Pavel Drozd
parent c4a651bcac
commit 01051016f5
3 changed files with 20 additions and 6 deletions

View file

@ -147,4 +147,16 @@ public class TestingExportImportResource {
String absolutePath = new File(System.getProperty("project.build.directory", "target")).getAbsolutePath();
return absolutePath;
}
@GET
@Path("/clear")
@Produces(MediaType.APPLICATION_JSON)
public Response clear() {
System.clearProperty(REALM_NAME);
System.clearProperty(PROVIDER);
System.clearProperty(ACTION);
System.clearProperty(FILE);
return Response.ok().build();
}
}

View file

@ -96,4 +96,9 @@ public interface TestingExportImportResource {
@Produces(MediaType.APPLICATION_JSON)
public String getExportImportTestDirectory();
@GET
@Path("/clear")
@Produces(MediaType.APPLICATION_JSON)
public Response clear();
}

View file

@ -492,7 +492,6 @@ public class BrokerLinkAndTokenExchangeTest extends AbstractServletsAdapterTest
testExternalExchange();
testingClient.testing().exportImport().setProvider(SingleFileExportProviderFactory.PROVIDER_ID);
String targetFilePath = testingClient.testing().exportImport().getExportImportTestDirectory() + File.separator + "singleFile-full.json";
//System.out.println("TARGET PATH: " + targetFilePath);
testingClient.testing().exportImport().setFile(targetFilePath);
testingClient.testing().exportImport().setAction(ExportImportConfig.ACTION_EXPORT);
testingClient.testing().exportImport().setRealmName(CHILD_IDP);
@ -502,12 +501,10 @@ public class BrokerLinkAndTokenExchangeTest extends AbstractServletsAdapterTest
testingClient.testing().exportImport().setAction(ExportImportConfig.ACTION_IMPORT);
testingClient.testing().exportImport().runImport();
//System.out.println("************* AFTER IMPORT");
testingClient.testing().exportImport().clear();
testExternalExchange();
//Thread.sleep(1000000000l);
}