diff --git a/test/framework/src/main/java/org/elasticsearch/test/AbstractQueryTestCase.java b/test/framework/src/main/java/org/elasticsearch/test/AbstractQueryTestCase.java index 842b14cf386..77924d4d99d 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/AbstractQueryTestCase.java +++ b/test/framework/src/main/java/org/elasticsearch/test/AbstractQueryTestCase.java @@ -317,8 +317,15 @@ public abstract class AbstractQueryTestCase> * declared by overriding {@link #getObjectsHoldingArbitraryContent()} */ public final void testUnknownObjectException() throws IOException { - //TODO building json by concatenating strings makes the code unmaintainable, we should rewrite this test String validQuery = createTestQueryBuilder().toString(); + unknownObjectExceptionTest(validQuery); + for (String query : getAlternateVersions().keySet()) { + unknownObjectExceptionTest(query); + } + } + + private void unknownObjectExceptionTest(String validQuery) throws IOException { + //TODO building json by concatenating strings makes the code unmaintainable, we should rewrite this test assertThat(validQuery, containsString("{")); int level = 0; boolean withinQuotes = false;