QueryUtils { public static String orderBy(String query, Collection<String> columns, String order) { return orderBy(new StringBuilder(query), columns, order).toString(); } private  QueryUtils(); static String where(String query, Collection<String> filters, String operator); static StringBuilder where(StringBuilder query, Collection<String> filters); static StringBuilder where(StringBuilder query, Collection<String> filters, String operator); static String orderBy(String query, Collection<String> columns, String order); static StringBuilder orderBy(StringBuilder query, Collection<String> columns, String order); static StringBuilder orderBy(StringBuilder query, Collection<OrderBy> orderBys); static StringBuilder join(StringBuilder query, Collection<Join> joins); static SelectQuery union(SelectQuery... queries); static StringBuilder eq(StringBuilder query, String column, Object value); static StringBuilder in(StringBuilder query, String column, Collection<? extends Object> values); static String eqOrIn(String column, Object... values); static String eqOrIn(String column, Collection<? extends Object> values); static StringBuilder eqOrIn(StringBuilder query, String column, Object... values); static StringBuilder eqOrIn(StringBuilder query, String column, Collection<? extends Object> values); static final String INNER; static final String LEFT; static final String RIGHT; static final String OR; static final String AND; static final String DESC; static final String ASC; }
@Test(dataProvider = "orderBy") public void testOrderBy(String query, Collection<String> columns, String order, String queryOrderBy) { assertEquals(orderBy(query, columns, order), queryOrderBy); }