Skip to content

Commit

Permalink
[KEYCLOAK-8185] add clear method to exportimport resource
Browse files Browse the repository at this point in the history
  • Loading branch information
wyvie authored and pdrozd committed Sep 13, 2018
1 parent c4a651b commit 0105101
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,4 +147,16 @@ public String getExportImportTestDirectory() {
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();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,9 @@ public interface TestingExportImportResource {
@Produces(MediaType.APPLICATION_JSON)
public String getExportImportTestDirectory();

@GET
@Path("/clear")
@Produces(MediaType.APPLICATION_JSON)
public Response clear();

}
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,6 @@ public void testExportImport() throws Exception {
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);
Expand All @@ -502,12 +501,10 @@ public void testExportImport() throws Exception {
testingClient.testing().exportImport().setAction(ExportImportConfig.ACTION_IMPORT);

testingClient.testing().exportImport().runImport();
//System.out.println("************* AFTER IMPORT");
testExternalExchange();
//Thread.sleep(1000000000l);


testingClient.testing().exportImport().clear();

testExternalExchange();
}


Expand Down

0 comments on commit 0105101

Please sign in to comment.