@Test
    void testIllegalQuery() {
        Execution exc = newExecution(new GroupingExecutor());

        Query query = new Query();
        query.getModel().getQueryTree().setRoot(new NullItem());

        Result result = exc.search(query);
        com.yahoo.search.result.ErrorMessage message = result.hits().getError();

        assertNotNull(message, "Got error");
        assertEquals("Illegal query", message.getMessage());
        assertEquals("No query", message.getDetailedMessage());
        assertEquals(3, message.getCode());
    }
Tests the internal rewriting of rank properties which happens in the query.prepare() call
(triggered by the exc.search call in the below).
container-search/src/test/java/com/yahoo/search/grouping/vespa/GroupingExecutorTestCase.java