فهرست منبع

fix deletion in /it/CrudTestBase

Keiichi Watanabe 8 سال پیش
والد
کامیت
3358e594df
1فایلهای تغییر یافته به همراه8 افزوده شده و 3 حذف شده
  1. 8 3
      src/test/java/org/codelibs/fess/it/CrudTestBase.java

+ 8 - 3
src/test/java/org/codelibs/fess/it/CrudTestBase.java

@@ -81,10 +81,15 @@ public abstract class CrudTestBase extends ITBase {
     @AfterEach
     protected void tearDown() {
         final Map<String, Object> searchBody = createSearchBody(SEARCH_ALL_NUM);
+        int count = 0;
         List<String> idList = getIdList(searchBody);
-        idList.forEach(id -> {
-            checkDeleteMethod(getItemEndpointSuffix() + "/" + id);
-        });
+        while(idList.size() > 0 && count < NUM) {
+            final String id = idList.get(0);
+            checkDeleteMethod(getItemEndpointSuffix() + "/" + id.toString());
+            refresh();
+            idList = getIdList(searchBody);
+            count += 1;
+        }
     }
 
     @AfterAll