Response response = doCreateJob("Test", "/tmp/script.pig", "-useHCatalog");
Assert.assertEquals(201, response.getStatus());
reset(api);
api.killJob(eq("job_id_##"));
replay(api);
JSONObject obj = (JSONObject)response.getEntity();
PigJob job = ((PigJob)obj.get("job"));
response = jobService.killJob(job.getId());
Assert.assertEquals(204, response.getStatus());