From 8391e6de3766bb3ed03e19650fa0945701f0da20 Mon Sep 17 00:00:00 2001 From: javanna Date: Mon, 8 Aug 2016 18:48:18 +0200 Subject: [PATCH] [TEST] enable testUnknownObjectException for alternate query versions too --- .../org/elasticsearch/test/AbstractQueryTestCase.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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;