@Test public void assertFailoverIfUnnecessary() { when(configService.load(true)).thenReturn(JobConfiguration.newBuilder("test_job", 3).cron("0/1 * * * * ?").failover(false).build()); liteJobFacade.failoverIfNecessary(); verify(failoverService, times(0)).failoverIfNecessary(); }
@Override public void failoverIfNecessary() { if (configService.load(true).isFailover()) { failoverService.failoverIfNecessary(); } }
LiteJobFacade implements JobFacade { @Override public void failoverIfNecessary() { if (configService.load(true).isFailover()) { failoverService.failoverIfNecessary(); } } }
LiteJobFacade implements JobFacade { @Override public void failoverIfNecessary() { if (configService.load(true).isFailover()) { failoverService.failoverIfNecessary(); } } LiteJobFacade(final CoordinatorRegistryCenter regCenter, final String jobName, final Collection<ElasticJobListener> elasticJobListeners, final TracingConfiguration tracingConfig); }
LiteJobFacade implements JobFacade { @Override public void failoverIfNecessary() { if (configService.load(true).isFailover()) { failoverService.failoverIfNecessary(); } } LiteJobFacade(final CoordinatorRegistryCenter regCenter, final String jobName, final Collection<ElasticJobListener> elasticJobListeners, final TracingConfiguration tracingConfig); @Override JobConfiguration loadJobConfiguration(final boolean fromCache); @Override void checkJobExecutionEnvironment(); @Override void failoverIfNecessary(); @Override void registerJobBegin(final ShardingContexts shardingContexts); @Override void registerJobCompleted(final ShardingContexts shardingContexts); @Override ShardingContexts getShardingContexts(); @Override boolean misfireIfRunning(final Collection<Integer> shardingItems); @Override void clearMisfire(final Collection<Integer> shardingItems); @Override boolean isExecuteMisfired(final Collection<Integer> shardingItems); @Override boolean isNeedSharding(); @Override void beforeJobExecuted(final ShardingContexts shardingContexts); @Override void afterJobExecuted(final ShardingContexts shardingContexts); @Override void postJobExecutionEvent(final JobExecutionEvent jobExecutionEvent); @Override void postJobStatusTraceEvent(final String taskId, final State state, final String message); }
LiteJobFacade implements JobFacade { @Override public void failoverIfNecessary() { if (configService.load(true).isFailover()) { failoverService.failoverIfNecessary(); } } LiteJobFacade(final CoordinatorRegistryCenter regCenter, final String jobName, final Collection<ElasticJobListener> elasticJobListeners, final TracingConfiguration tracingConfig); @Override JobConfiguration loadJobConfiguration(final boolean fromCache); @Override void checkJobExecutionEnvironment(); @Override void failoverIfNecessary(); @Override void registerJobBegin(final ShardingContexts shardingContexts); @Override void registerJobCompleted(final ShardingContexts shardingContexts); @Override ShardingContexts getShardingContexts(); @Override boolean misfireIfRunning(final Collection<Integer> shardingItems); @Override void clearMisfire(final Collection<Integer> shardingItems); @Override boolean isExecuteMisfired(final Collection<Integer> shardingItems); @Override boolean isNeedSharding(); @Override void beforeJobExecuted(final ShardingContexts shardingContexts); @Override void afterJobExecuted(final ShardingContexts shardingContexts); @Override void postJobExecutionEvent(final JobExecutionEvent jobExecutionEvent); @Override void postJobStatusTraceEvent(final String taskId, final State state, final String message);  }