@Test public void assertFillJobNodeIfNotNullAndOverwriteEnabledAndValueDifferent() throws NoSuchFieldException { when(coordinatorRegistryCenter.isExisted("/testJob/config/cron")).thenReturn(true); when(coordinatorRegistryCenter.getDirectly("/testJob/config/cron")).thenReturn("0/1 * * * * ?"); JobConfigurationFieldUtil.setSuperFieldValue(jobConfig, "overwrite", true); jobNodeStorage.fillJobNodeIfNullOrOverwrite("config/cron", "0/2 * * * * ?"); verify(coordinatorRegistryCenter).isExisted("/testJob/config/cron"); verify(coordinatorRegistryCenter).getDirectly("/testJob/config/cron"); verify(coordinatorRegistryCenter).persist("/testJob/config/cron", "0/2 * * * * ?"); }
@Before public void reset() { JobConfigurationFieldUtil.setSuperFieldValue(jobConfig, "overwrite", false); }