final Map<JobId, Job> jobs = client.jobs().get();
// Verify job1 is still deployed and the prefix file has not been deleted.
assertThat(jobs, hasKey(jobId1));
final JobStatus status1 = client.jobStatus(jobId1).get();
assertThat(status1.getDeployments().size(), is(1));
assertTrue(fileExists(prefixDirectory, jobId1.getName()));
// Verify job2 still exists, is not deployed, and the prefix file is still there.
assertThat(jobs, hasKey(jobId2));
final JobStatus status2 = client.jobStatus(jobId2).get();
assertThat(status2.getDeployments().size(), is(0));
assertTrue(fileExists(prefixDirectory, jobId2.getName()));
// Verify that job3 has been deleted (which means it has also been undeployed), and
// the prefix file has been deleted.
assertThat(jobs, not(hasKey(jobId3)));