### Question:
ReadyService { public void setMisfireDisabled(final String jobName) { Optional<CloudJobConfiguration> cloudJobConfig = configService.load(jobName); if (cloudJobConfig.isPresent() && null != regCenter.getDirectly(ReadyNode.getReadyJobNodePath(jobName))) { regCenter.persist(ReadyNode.getReadyJobNodePath(jobName), "1"); } } ReadyService(final CoordinatorRegistryCenter regCenter); void addTransient(final String jobName); void addDaemon(final String jobName); void setMisfireDisabled(final String jobName); Collection<JobContext> getAllEligibleJobContexts(final Collection<JobContext> ineligibleJobContexts); void remove(final Collection<String> jobNames); Map<String, Integer> getAllReadyTasks();  }### Answer:
@Test public void assertSetMisfireDisabledWhenJobIsNotExisted() { Mockito.when(configService.load("test_job")).thenReturn(Optional.<CloudJobConfiguration>absent()); readyService.setMisfireDisabled("test_job"); Mockito.verify(regCenter, Mockito.times(0)).persist("/state/ready/test_job", "1"); }
@Test public void assertSetMisfireDisabledWhenReadyNodeNotExisted() { Mockito.when(configService.load("test_job")).thenReturn(Optional.of(CloudJobConfigurationBuilder.createCloudJobConfiguration("test_job"))); readyService.setMisfireDisabled("test_job"); Mockito.verify(regCenter, Mockito.times(0)).persist("/state/ready/test_job", "1"); }
@Test public void assertSetMisfireDisabledWhenReadyNodeExisted() { Mockito.when(configService.load("test_job")).thenReturn(Optional.of(CloudJobConfigurationBuilder.createCloudJobConfiguration("test_job"))); Mockito.when(regCenter.getDirectly("/state/ready/test_job")).thenReturn("100"); readyService.setMisfireDisabled("test_job"); Mockito.verify(regCenter).persist("/state/ready/test_job", "1"); }