MCPcopy Create free account
hub / github.com/OpenTSDB/opentsdb / mockSystemTime

Method mockSystemTime

test/core/TestTsdbQuery.java:758–764  ·  view source on GitHub ↗
(long newTimestamp)

Source from the content-addressed store, hash-verified

756 }
757
758 private void mockSystemTime(long newTimestamp) {
759 PowerMockito.mockStatic(DateTime.class);
760 PowerMockito.when(DateTime.currentTimeMillis()).thenReturn(newTimestamp);
761 PowerMockito.when(DateTime.getDurationUnits(anyString())).thenCallRealMethod();
762 PowerMockito.when(DateTime.getDurationInterval(anyString())).thenCallRealMethod();
763 PowerMockito.when(DateTime.parseDuration(anyString())).thenCallRealMethod();
764 }
765
766 private void mockEnableRollupQuerySplitting() {
767 Whitebox.setInternalState(tsdb, "rollups_split_queries", true);

Calls 4

currentTimeMillisMethod · 0.95
getDurationUnitsMethod · 0.95
getDurationIntervalMethod · 0.95
parseDurationMethod · 0.95

Tested by

no test coverage detected