### Question:
JobConfigManager { public void addJob(IJob ijob) throws Exception { TimerContext addJobTimerContext = addJobTimer.time(); ZnodeJob job = new ZnodeJob(ijob); String jobPath = getJobPath(ijob.getId()); try { final String jobCodec = new String(codec.encode(job.getRootData())); jobSizePersistHisto.update(jobCodec.length()); spawnDataStore.putAsChild(SPAWN_JOB_CONFIG_PATH, job.getId(), jobCodec); if (job.getConfig() == null) { writeUpdateIfDataNotNull(jobPath + configChildName, ""); } else { writeUpdateIfDataNotNull(jobPath + configChildName, job.getConfig()); } if (job.getQueryConfig() == null) { writeUpdateIfDataNotNull(jobPath + queryConfigChildName, ""); } else { writeUpdateIfDataNotNull(jobPath + queryConfigChildName, new String(codec.encode(job.getQueryConfig()))); } spawnDataStore.put(jobPath + tasksChildName, ""); } finally { addJobTimerContext.stop(); } } @Deprecated  JobConfigManager(SpawnDataStore spawnDataStore);  JobConfigManager(SpawnDataStore spawnDataStore, JobExpander jobExpander); String getExpandedConfig(String jobUUID); String getExpandedConfig(String rawConfig, Collection<JobParameter> parameters); void writeUpdateIfDataNotNull(String path, String data); void addJob(IJob ijob); void updateJob(IJob ijob); IJob getJob(String jobId); String getConfig(String jobUUID); void setConfig(String jobId, String config); @Scaling(SETUP) Map<String, IJob> loadJobs(); void deleteJob(String jobUUID);  }### Answer:
@Test public void testBasicExists() throws Exception { JobConfigManager jcm = getJobConfigManager(); String id = "foo"; IJob job = new ZnodeJob(id); job.setQueryConfig(new JobQueryConfig()); jcm.addJob(job); assertNotNull(spawnDataStore.getChild(SPAWN_JOB_CONFIG_PATH, id)); assertNotNull(spawnDataStore.get(SPAWN_JOB_CONFIG_PATH + "/foo/config")); assertNotNull(spawnDataStore.get(SPAWN_JOB_CONFIG_PATH + "/foo/queryconfig")); }
@Test public void testDeserQC() throws Exception { JobConfigManager jcm = getJobConfigManager(); String id = "foo"; IJob job = new ZnodeJob(id); jcm.addJob(job); String raw = spawnDataStore.get(SPAWN_JOB_CONFIG_PATH + "/foo/queryconfig"); assertNotNull(raw); JobQueryConfig jqc = codec.decode(JobQueryConfig.class, StringSerializer.deserialize(raw.getBytes()).getBytes()); assertEquals(jqc, new JobQueryConfig()); }
@Test public void testGetJobs() throws Exception { JobConfigManager jcm = getJobConfigManager(); jcm.addJob(new ZnodeJob("foo")); jcm.addJob(new ZnodeJob("bar")); new JobConfigManager(spawnDataStore); }