@Test public void shouldBuildQueryParamsFromGridSettings() { when(gridSettings.getPage()).thenReturn(3); when(gridSettings.getRows()).thenReturn(50); when(gridSettings.getSortColumn()).thenReturn("field"); when(gridSettings.getSortDirection()).thenReturn("desc"); QueryParams queryParams = QueryParamsBuilder.buildQueryParams(gridSettings); assertNotNull(queryParams); assertPagination(queryParams, 3, 50); assertEquals(2, queryParams.getOrderList().size()); assertOrderPresent(queryParams, 0, "field", Order.Direction.DESC); assertDefaultIdOrder(queryParams, 1); }
public static QueryParams buildQueryParams(GridSettings settings) { return buildQueryParams(settings, buildOrderList(settings, null)); }
QueryParamsBuilder { public static QueryParams buildQueryParams(GridSettings settings) { return buildQueryParams(settings, buildOrderList(settings, null)); } }
QueryParamsBuilder { public static QueryParams buildQueryParams(GridSettings settings) { return buildQueryParams(settings, buildOrderList(settings, null)); } private  QueryParamsBuilder(); }
QueryParamsBuilder { public static QueryParams buildQueryParams(GridSettings settings) { return buildQueryParams(settings, buildOrderList(settings, null)); } private  QueryParamsBuilder(); static QueryParams buildQueryParams(GridSettings settings); static QueryParams buildQueryParams(GridSettings settings, Map<String, Object> lookupMap); static QueryParams buildQueryParams(GridSettings settings, List<Order> orderList); static List<Order> buildOrderList(GridSettings settings, Map<String, Object> lookupMap); }
QueryParamsBuilder { public static QueryParams buildQueryParams(GridSettings settings) { return buildQueryParams(settings, buildOrderList(settings, null)); } private  QueryParamsBuilder(); static QueryParams buildQueryParams(GridSettings settings); static QueryParams buildQueryParams(GridSettings settings, Map<String, Object> lookupMap); static QueryParams buildQueryParams(GridSettings settings, List<Order> orderList); static List<Order> buildOrderList(GridSettings settings, Map<String, Object> lookupMap); static final int DEFAULT_PAGE; static final int DEFAULT_PAGE_SIZE; }