package org.docksidestage.app.web.product;

import org.dbflute.optional.OptionalThing;
import org.dbflute.utflute.lastaflute.mock.TestingHtmlData;
import org.docksidestage.unit.UnitHarborTestCase;
import org.lastaflute.web.response.HtmlResponse;

/**
 * @author jflute
 */
public class ProductListActionTest extends UnitHarborTestCase {

    public void test_index_success_by_productName() throws Exception {
        // ## Arrange ##
        ProductListAction action = new ProductListAction();
        inject(action);
        ProductSearchForm form = new ProductSearchForm();
        form.productName = "a";

        // ## Act ##
        HtmlResponse response = action.index(OptionalThing.of(2), form);

        // ## Assert ##
        TestingHtmlData htmlData = validateHtmlData(response);
        htmlData.requiredList("beans", ProductSearchRowBean.class).forEach(bean -> {
            log(bean);
            assertContains(bean.productName, form.productName);
        });
    }
}

@@ -600,16 +600,44 @@
 e = %22a%22;
+%0A        int pageNumber = 2;
 %0A%0A      
@@ -713,17 +713,26 @@
 hing.of(
-2
+pageNumber
 ), form)
@@ -955,16 +955,26 @@
 Contains
+IgnoreCase
 (bean.pr

upgrade UTFlute