[TEST] enable testUnknownObjectException for alternate query versions too

This commit is contained in:
javanna 2016-08-08 18:48:18 +02:00 committed by Luca Cavanna
parent 2c44278ce8
commit 8391e6de37
1 changed files with 8 additions and 1 deletions

View File

@ -317,8 +317,15 @@ public abstract class AbstractQueryTestCase<QB extends AbstractQueryBuilder<QB>>
* declared by overriding {@link #getObjectsHoldingArbitraryContent()} * declared by overriding {@link #getObjectsHoldingArbitraryContent()}
*/ */
public final void testUnknownObjectException() throws IOException { 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(); 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("{")); assertThat(validQuery, containsString("{"));
int level = 0; int level = 0;
boolean withinQuotes = false; boolean withinQuotes = false;