@Test public void should_autogenerate_table_from_the_ajax_criterias() { request.addParameter("columns[0][data]", "id"); request.addParameter("columns[1][data]", "firstName"); request.addParameter("columns[2][data]", "lastName"); request.addParameter("columns[3][data]", "mail"); DatatablesCriterias criteria = DatatablesCriterias.getFromRequest(request); HtmlTable table = new HtmlTableBuilder<Person>().newBuilder("tableId", persons, request, null) .auto(criteria) .build(); assertThat(table.getBodyRows()).hasSize(10); assertThat(table.getBodyRows().get(0).getColumns()).hasSize(4); assertThat(table.getBodyRows().get(0).getColumns().get(0).getContent().toString()).isEqualTo("1"); assertThat(table.getBodyRows().get(0).getColumns().get(1).getContent().toString()).isEqualTo("firstName1"); assertThat(table.getBodyRows().get(0).getColumns().get(2).getContent().toString()).isEqualTo("lastName1"); assertThat(table.getBodyRows().get(0).getColumns().get(3).getContent().toString()).isEqualTo("mail1"); assertThat(table.getBodyRows().get(9).getColumns().get(0).getContent().toString()).isEqualTo("10"); assertThat(table.getBodyRows().get(9).getColumns().get(1).getContent().toString()).isEqualTo("firstName10"); assertThat(table.getBodyRows().get(9).getColumns().get(2).getContent().toString()).isEqualTo("lastName10"); assertThat(table.getBodyRows().get(9).getColumns().get(3).getContent().toString()).isEqualTo("mail10"); }
public ColumnStep newBuilder(String id, List<T> data, HttpServletRequest request) { return new Steps<T>(id, data, request); }
HtmlTableBuilder { public ColumnStep newBuilder(String id, List<T> data, HttpServletRequest request) { return new Steps<T>(id, data, request); } }
HtmlTableBuilder { public ColumnStep newBuilder(String id, List<T> data, HttpServletRequest request) { return new Steps<T>(id, data, request); }  }
HtmlTableBuilder { public ColumnStep newBuilder(String id, List<T> data, HttpServletRequest request) { return new Steps<T>(id, data, request); }  ColumnStep newBuilder(String id, List<T> data, HttpServletRequest request); ColumnStep newBuilder(String id, List<T> data, HttpServletRequest request, ExportConf exportConf); }
HtmlTableBuilder { public ColumnStep newBuilder(String id, List<T> data, HttpServletRequest request) { return new Steps<T>(id, data, request); }  ColumnStep newBuilder(String id, List<T> data, HttpServletRequest request); ColumnStep newBuilder(String id, List<T> data, HttpServletRequest request, ExportConf exportConf);  }