@Test
    void testOrdering() {
        {
            String yql = "select%20ignoredfield%20from%20ignoredsource%20where%20title%20contains%20%22madonna%22%20order%20by%20something%2C%20shoesize%20desc%20limit%20300%20timeout%203";
            Query query = new Query("search/?yql=" + yql);
            execution.search(query);
            assertEquals(2, query.getRanking().getSorting().fieldOrders()
                    .size());
            assertEquals("something", query.getRanking().getSorting()
                    .fieldOrders().get(0).getFieldName());
            assertEquals(Order.ASCENDING, query.getRanking().getSorting()
                    .fieldOrders().get(0).getSortOrder());
            assertEquals("shoesize", query.getRanking().getSorting()
                    .fieldOrders().get(1).getFieldName());
            assertEquals(Order.DESCENDING, query.getRanking().getSorting()
                    .fieldOrders().get(1).getSortOrder());
            assertEquals("select ignoredfield from ignoredsource where title contains \"madonna\" order by something, shoesize desc limit 300 timeout 3", query.yqlRepresentation());
        }
        {
            String yql = "select%20ignoredfield%20from%20ignoredsource%20where%20title%20contains%20%22madonna%22%20order%20by%20other%20limit%20300%20timeout%203";
            Query query = new Query("search/?yql=" + yql);
            execution.search(query);
            assertEquals("other", query.getRanking().getSorting().fieldOrders()
                    .get(0).getFieldName());
            assertEquals(Order.ASCENDING, query.getRanking().getSorting()
                    .fieldOrders().get(0).getSortOrder());
            assertEquals("select ignoredfield from ignoredsource where title contains \"madonna\" order by other limit 300 timeout 3", query.yqlRepresentation());
        }
        {
            String yql = "select%20foo%20from%20bar%20where%20title%20contains%20%22madonna%22%20order%20by%20%5B%7B%22function%22%3A%20%22uca%22%2C%20%22locale%22%3A%20%22en_US%22%2C%20%22strength%22%3A%20%22IDENTICAL%22%7D%5Dother%20desc%2C%20%5B%7B%22function%22%3A%20%22lowercase%22%7D%5Dsomething%20limit%20300%20timeout%203";
            Query query = new Query("search/?yql=" + yql);
            execution.search(query);
            {
                FieldOrder fieldOrder = query.getRanking().getSorting().fieldOrders().get(0);
                assertEquals("other", fieldOrder.getFieldName());
                assertEquals(Order.DESCENDING, fieldOrder.getSortOrder());
                AttributeSorter sorter = fieldOrder.getSorter();
                assertEquals(UcaSorter.class, sorter.getClass());
                UcaSorter uca = (UcaSorter) sorter;
                assertEquals("en_US", uca.getLocale());
                assertEquals(UcaSorter.Strength.IDENTICAL, uca.getStrength());
            }
            {
                FieldOrder fieldOrder = query.getRanking().getSorting().fieldOrders().get(1);
                assertEquals("something", fieldOrder.getFieldName());
                assertEquals(Order.ASCENDING, fieldOrder.getSortOrder());
                AttributeSorter sorter = fieldOrder.getSorter();
                assertEquals(LowerCaseSorter.class, sorter.getClass());
            }
            assertEquals("select foo from bar where title contains \"madonna\" order by [{\"function\": \"uca\", \"locale\": \"en_US\", \"strength\": \"IDENTICAL\"}]other desc, [{\"function\": \"lowercase\"}]something limit 300 timeout 3",
                    query.yqlRepresentation());
        }
    }
Smoke test for first generation YQL+ integration.
container-search/src/test/java/com/yahoo/search/yql/MinimalQueryInserterTestCase.java