public JsonWrapper call() throws Exception {
RestTemplate template = new RestTemplate();
ResponseEntity<String> result = template.exchange(resource, HttpMethod.GET, null, String.class);
JsonWrapper wrapper = new JsonWrapper(result.getBody());
// System.err.println(wrapper);
BatchStatus status = wrapper.get("jobExecution.status", BatchStatus.class);
return status.isGreaterThan(BatchStatus.STOPPING) ? wrapper : null;
}
});
JsonWrapper jobExecution = poll.get(500L, TimeUnit.MILLISECONDS);
assertNotNull(jobExecution);
BatchStatus status = jobExecution.get("jobExecution.status", BatchStatus.class);
assertEquals(BatchStatus.STOPPED, status);
}