public void testGetters() throws Exception {
long batchSize = 20;
long startMilliTime = System.currentTimeMillis() - 3000L;
long endMilliTime = System.currentTimeMillis() - 2000L;
List<String> majorVersions = Arrays.asList("1", "2", "3");
LogQuery logQuery = new LogQuery()
.batchSize((int) batchSize)
.startTimeMillis(startMilliTime)
.endTimeMillis(endMilliTime)
.minLogLevel(LogService.LogLevel.WARN)
.includeIncomplete(true)
.includeAppLogs(true)
.offset(null)
.majorVersionIds(majorVersions);
executeQuery(logQuery);
// The LogQuery should be unmodified, so you can re-use.
assertEquals(batchSize, (long)logQuery.getBatchSize());
assertEquals(startMilliTime, (long)logQuery.getStartTimeMillis());
assertEquals(startMilliTime * 1000, (long)logQuery.getStartTimeUsec());
assertEquals(endMilliTime, (long)logQuery.getEndTimeMillis());
assertEquals(endMilliTime * 1000, (long)logQuery.getEndTimeUsec());
assertEquals(LogService.LogLevel.WARN, logQuery.getMinLogLevel());
assertEquals(true, logQuery.getIncludeIncomplete());
assertEquals(true, logQuery.getIncludeAppLogs());
assertEquals(null, logQuery.getOffset());
assertEquals(majorVersions, logQuery.getMajorVersionIds());
assertEquals(new ArrayList<String>(), logQuery.getRequestIds());
List<LogQuery.Version> versions = Arrays.asList(new LogQuery.Version("module1", "1"), new LogQuery.Version("module2", "3"));
logQuery = new LogQuery()
.versions(versions)
.startTimeMillis(startMilliTime);
executeQuery(logQuery);
assertEquals(versions, logQuery.getVersions());
}