PushGatewayPeriodical extends Periodical { @Override public int getPeriodSeconds() { return Ints.saturatedCast(configuration.getReportInterval().toSeconds()); } @Inject  PushGatewayPeriodical(MetricsPrometheusReporterConfiguration configuration,
                                 CollectorRegistry collectorRegistry,
                                 PushGateway pushGateway); @Override void doRun(); @Override boolean runsForever(); @Override boolean stopOnGracefulShutdown(); @Override boolean masterOnly(); @Override boolean startOnThisNode(); @Override boolean isDaemon(); @Override int getInitialDelaySeconds(); @Override int getPeriodSeconds();  }
@Test public void getPeriodSecondsCorrespondesToConfiguration() throws Exception { final int reportIntervalInSeconds = Ints.saturatedCast(configuration.getReportInterval().toSeconds()); assertEquals(reportIntervalInSeconds, periodical.getPeriodSeconds()); }