From 7fafbebf2acff2438ae75f2098301cefc59829ce Mon Sep 17 00:00:00 2001 From: igarash1 Date: Wed, 30 May 2018 14:03:12 +0900 Subject: [PATCH] [WIP] Admin API Test: searchlist #1054 --- .../fess/it/admin/SearchListTests.java | 35 +++---------------- 1 file changed, 5 insertions(+), 30 deletions(-) diff --git a/src/test/java/org/codelibs/fess/it/admin/SearchListTests.java b/src/test/java/org/codelibs/fess/it/admin/SearchListTests.java index c8dc668fc8..edad05fe8e 100644 --- a/src/test/java/org/codelibs/fess/it/admin/SearchListTests.java +++ b/src/test/java/org/codelibs/fess/it/admin/SearchListTests.java @@ -93,8 +93,7 @@ protected Map createSearchBody(final int size) { @Override protected Map getUpdateMap() { final Map updateMap = new HashMap<>(); - // final Map doc = new HashMap<>(); - updateMap.put("click_count", 100); +// updateMap.put("click_count", 100); return updateMap; } @@ -102,15 +101,14 @@ protected Map getUpdateMap() { protected void testUpdate() { // Test: update settings api - // final Set keySet = createTestParam(0).keySet(); final Map updateMap = getUpdateMap(); final Map searchBody = createSearchBody(SEARCH_ALL_NUM); List> settings = getItemList(searchBody); - // logger.info("size of settings = " + settings.size()); for (Map setting : settings) { final Map requestBody = new HashMap<>(updateMap); final String idKey = getIdKey(); + requestBody.put("version", 1); requestBody.put("crud_mode", 2); @@ -124,32 +122,9 @@ protected void testUpdate() { doc.put("title", setting.get("title")); doc.put("role", "Rguest"); doc.put("boost", setting.get("boost")); - // doc.put("click_count", "100"); // Validation Error + // doc.put("click_count", 100); // Validation Error requestBody.put("doc", doc); - /* - // for debugging - logger.info("elements of requestBody..."); - - Set keySet = requestBody.keySet(); - for (String key : keySet) { - if (requestBody.get(key) != null) { - logger.info(key + ", " + requestBody.get(key).toString()); - } else { - logger.info(key + ", null"); - } - } - - logger.info("elements of setting..."); - - keySet = setting.keySet(); - for (String key : keySet) { - if (setting.get(key) != null) { - logger.info(key + ", " + setting.get(key).toString()); - } else { - logger.info(key + ", null"); - } - } - */ + checkPostMethod(requestBody, getItemEndpointSuffix()).then().body("response.status", equalTo(0)); refresh(); } @@ -159,7 +134,7 @@ protected void testUpdate() { @Override protected List> getItemList(final Map body) { - final String response = checkMethodBase(body).get(API_PATH + "/" + LIST_ENDPOINT_SUFFIX).asString(); + final String response = checkMethodBase(body).get(getApiPath() + "/" + getListEndpointSuffix()).asString(); final List> results = JsonPath.from(response).getList("response.docs"); return results; }