TaskVars extends AbstractIdleService implements EventSubscriber { @VisibleForTesting static String jobStatName(IScheduledTask task, ScheduleStatus status) { return String.format( "tasks_%s_%s", status, JobKeys.canonicalString(task.getAssignedTask().getTask().getJob())); } @Inject  TaskVars(Storage storage, final StatsProvider statProvider); @Subscribe void taskChangedState(TaskStateChange stateChange); @Subscribe void tasksDeleted(final TasksDeleted event); @Subscribe void taskVetoed(Vetoed event);  }
@Test public void testRackMissing() { expectStatusCountersInitialized(); expect(storageUtil.attributeStore.getHostAttributes("a")) .andReturn(Optional.absent()); IScheduledTask a = makeTask(JOB_A, RUNNING, "a"); expectStatExport(jobStatName(a, LOST), untrackedProvider); replayAndBuild(); schedulerActivated(); changeState(a, LOST); }