private void runImportExportTest(Map<String, JsonElement> importJson) throws Exception {
assertResponseStatus(doPostExternalAPI("/import", gson.toJson(importJson), ADMIN_HEADERS), HttpResponseStatus.OK);
HttpResponse response = doGetExternalAPI("/export", ADMIN_HEADERS);
assertResponseStatus(response, HttpResponseStatus.OK);
Reader reader = new InputStreamReader(response.getEntity().getContent(), Charsets.UTF_8);
Map<String, JsonElement> exportJson = new Gson().fromJson(reader,
new TypeToken<Map<String, JsonElement>>() {}.getType());
Assert.assertEquals(importJson.size(), exportJson.size());
assertImport(importJson, exportJson, AdminHandler.PROVIDERS);
assertImport(importJson, exportJson, AdminHandler.HARDWARE_TYPES);
assertImport(importJson, exportJson, AdminHandler.IMAGE_TYPES);
assertImport(importJson, exportJson, AdminHandler.SERVICES);
assertImport(importJson, exportJson, AdminHandler.CLUSTER_TEMPLATES);
assertImport(importJson, exportJson, AdminHandler.PARTIAL_TEMPLATES);
}