Replace magic number in test with random number.

This commit is contained in:
Isabel Drost-Fromm 2016-09-07 12:06:39 +02:00
parent c8a3b3c32f
commit b3a4a89151
1 changed files with 2 additions and 2 deletions

View File

@ -74,7 +74,7 @@ public class QuerySpecTests extends ESTestCase {
String specId = randomAsciiOfLength(50);
SearchSourceBuilder testRequest = new SearchSourceBuilder();
testRequest.size(23);
testRequest.size(randomInt());
testRequest.query(new MatchAllQueryBuilder());
List<RatedDocument> ratedDocs = new ArrayList<>();
@ -108,7 +108,7 @@ public class QuerySpecTests extends ESTestCase {
testItem.toXContent(builder, ToXContent.EMPTY_PARAMS);
XContentBuilder shuffled = shuffleXContent(builder);
XContentParser itemParser = XContentHelper.createParser(shuffled.bytes());
itemParser.nextToken(); // TODO this could be the reason why the metric roundtrip tests failed
itemParser.nextToken();
QueryParseContext queryContext = new QueryParseContext(searchRequestParsers.queryParsers, itemParser, ParseFieldMatcher.STRICT);
RankEvalContext rankContext = new RankEvalContext(ParseFieldMatcher.STRICT, queryContext,