@Test void canGetTrigger() { final String expression = "0 0 1 * * *"; this.environment.setProperty(DatabaseCleanupProperties.EXPRESSION_PROPERTY, expression); Mockito.when(this.cleanupProperties.getExpression()).thenReturn("0 0 0 * * *"); final Trigger trigger = this.task.getTrigger(); if (trigger instanceof CronTrigger) { final CronTrigger cronTrigger = (CronTrigger) trigger; Assertions.assertThat(cronTrigger.getExpression()).isEqualTo(expression); } else { Assertions.fail("Trigger was not of expected type: " + CronTrigger.class.getName()); } }
@Override public Trigger getTrigger() { final String expression = this.environment.getProperty( DatabaseCleanupProperties.EXPRESSION_PROPERTY, String.class, this.cleanupProperties.getExpression() ); return new CronTrigger(expression, JobConstants.UTC); }
DatabaseCleanupTask extends LeaderTask { @Override public Trigger getTrigger() { final String expression = this.environment.getProperty( DatabaseCleanupProperties.EXPRESSION_PROPERTY, String.class, this.cleanupProperties.getExpression() ); return new CronTrigger(expression, JobConstants.UTC); } }
DatabaseCleanupTask extends LeaderTask { @Override public Trigger getTrigger() { final String expression = this.environment.getProperty( DatabaseCleanupProperties.EXPRESSION_PROPERTY, String.class, this.cleanupProperties.getExpression() ); return new CronTrigger(expression, JobConstants.UTC); } DatabaseCleanupTask(
        @NotNull final DatabaseCleanupProperties cleanupProperties,
        @NotNull final Environment environment,
        @NotNull final DataServices dataServices,
        @NotNull final MeterRegistry registry
    ); }
DatabaseCleanupTask extends LeaderTask { @Override public Trigger getTrigger() { final String expression = this.environment.getProperty( DatabaseCleanupProperties.EXPRESSION_PROPERTY, String.class, this.cleanupProperties.getExpression() ); return new CronTrigger(expression, JobConstants.UTC); } DatabaseCleanupTask(
        @NotNull final DatabaseCleanupProperties cleanupProperties,
        @NotNull final Environment environment,
        @NotNull final DataServices dataServices,
        @NotNull final MeterRegistry registry
    ); @Override GenieTaskScheduleType getScheduleType(); @Override Trigger getTrigger(); @Override void run(); @Override void cleanup(); }
DatabaseCleanupTask extends LeaderTask { @Override public Trigger getTrigger() { final String expression = this.environment.getProperty( DatabaseCleanupProperties.EXPRESSION_PROPERTY, String.class, this.cleanupProperties.getExpression() ); return new CronTrigger(expression, JobConstants.UTC); } DatabaseCleanupTask(
        @NotNull final DatabaseCleanupProperties cleanupProperties,
        @NotNull final Environment environment,
        @NotNull final DataServices dataServices,
        @NotNull final MeterRegistry registry
    ); @Override GenieTaskScheduleType getScheduleType(); @Override Trigger getTrigger(); @Override void run(); @Override void cleanup();  }