assertEquals(ImmutableSet.<IJobConfiguration>of(), store.fetchJobs(MANAGER_2));
}
@Test
public void testJobStoreSameEnvironment() {
IJobConfiguration templateConfig = makeJob("labrat");
JobConfiguration prodBuilder = templateConfig.newBuilder();
prodBuilder.getKey().setEnvironment("prod");
IJobConfiguration prod = IJobConfiguration.build(prodBuilder);
JobConfiguration stagingBuilder = templateConfig.newBuilder();
stagingBuilder.getKey().setEnvironment("staging");
IJobConfiguration staging = IJobConfiguration.build(stagingBuilder);
store.saveAcceptedJob(MANAGER_1, prod);
store.saveAcceptedJob(MANAGER_1, staging);
assertNull(store.fetchJob(
MANAGER_1,
IJobKey.build(templateConfig.getKey().newBuilder().setEnvironment("test"))).orNull());
assertEquals(prod, store.fetchJob(MANAGER_1, prod.getKey()).orNull());
assertEquals(staging, store.fetchJob(MANAGER_1, staging.getKey()).orNull());
store.removeJob(prod.getKey());
assertNull(store.fetchJob(MANAGER_1, prod.getKey()).orNull());
assertEquals(staging, store.fetchJob(MANAGER_1, staging.getKey()).orNull());
}