[TEST] expand AbstractQueryTestCase#testQueryWrappedInArray to run against query alternate versions
This commit is contained in:
parent
bf0e42aaeb
commit
329eaaea65
|
@ -339,10 +339,17 @@ public abstract class AbstractQueryTestCase<QB extends AbstractQueryBuilder<QB>>
|
||||||
* Test that wraps the randomly generated query into an array as follows: { "query_name" : [{}]}
|
* Test that wraps the randomly generated query into an array as follows: { "query_name" : [{}]}
|
||||||
* This causes unexpected situations in parser code that may not be handled properly.
|
* This causes unexpected situations in parser code that may not be handled properly.
|
||||||
*/
|
*/
|
||||||
public void testQueryWrappedInArray() throws IOException {
|
public final void testQueryWrappedInArray() throws IOException {
|
||||||
QB queryBuilder = createTestQueryBuilder();
|
QB queryBuilder = createTestQueryBuilder();
|
||||||
String validQuery = queryBuilder.toString();
|
|
||||||
String queryName = queryBuilder.getName();
|
String queryName = queryBuilder.getName();
|
||||||
|
String validQuery = queryBuilder.toString();
|
||||||
|
queryWrappedInArrayTest(queryName, validQuery);
|
||||||
|
for (String query : getAlternateVersions().keySet()) {
|
||||||
|
queryWrappedInArrayTest(queryName, query);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void queryWrappedInArrayTest(String queryName, String validQuery) throws IOException {
|
||||||
int i = validQuery.indexOf("\"" + queryName + "\"");
|
int i = validQuery.indexOf("\"" + queryName + "\"");
|
||||||
assertThat(i, greaterThan(0));
|
assertThat(i, greaterThan(0));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue