@Test public void shouldBuildQueryParamsForLookups() { when(gridSettings.getPage()).thenReturn(7); when(gridSettings.getRows()).thenReturn(80); Map<String, Object> lookupMap = new LinkedHashMap<>(); lookupMap.put("field1", null); lookupMap.put("field2", null); lookupMap.put("field3", null); QueryParams queryParams = QueryParamsBuilder.buildQueryParams(gridSettings, lookupMap); assertNotNull(queryParams); assertPagination(queryParams, 7, 80); assertEquals(4, queryParams.getOrderList().size()); assertOrderPresent(queryParams, 0, "field1", Order.Direction.ASC); assertOrderPresent(queryParams, 1, "field2", Order.Direction.ASC); assertOrderPresent(queryParams, 2, "field3", Order.Direction.ASC); assertDefaultIdOrder(queryParams, 3); }
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; }