Tests: Using UTC time zone in RangeQueryBuilderTest to make forbidden apis checker happy

This commit is contained in:
Christoph Büscher 2015-06-18 16:29:30 +02:00
parent cccc71f1e4
commit cfae809e6d

View File

@ -61,8 +61,8 @@ public class RangeQueryBuilderTest extends BaseQueryTestCase<RangeQueryBuilder>
} else {
// use mapped date field, using date string representation
query = new RangeQueryBuilder(DATE_FIELD_NAME);
query.from(new DateTime(System.currentTimeMillis() - randomIntBetween(0, 1000000)).toString());
query.to(new DateTime(System.currentTimeMillis() + randomIntBetween(0, 1000000)).toString());
query.from(new DateTime(System.currentTimeMillis() - randomIntBetween(0, 1000000), DateTimeZone.UTC).toString());
query.to(new DateTime(System.currentTimeMillis() + randomIntBetween(0, 1000000), DateTimeZone.UTC).toString());
// Create timestamp option only then we have a date mapper, otherwise we could trigger exception.
if (createContext().mapperService().smartNameFieldType(DATE_FIELD_NAME) != null) {
if (randomBoolean()) {