@SuppressWarnings("unchecked")
	@Test
	public void testGetBatchJobs() throws Exception {
		mockMvc.perform(
				post("/jobs/definitions").param("name", "job1").param("definition", JOB_DEFINITION).accept(
						MediaType.APPLICATION_JSON)).andExpect(status().isCreated());
		mockMvc.perform(
				post("/jobs/definitions").param("name", "job2").param("definition", JOB_DEFINITION).accept(
						MediaType.APPLICATION_JSON)).andExpect(status().isCreated());
		JobExecutionInfo info = new JobExecutionInfo(execution, timeZone);
		mockMvc.perform(
				get("/jobs/configurations").accept(
						MediaType.APPLICATION_JSON)).andExpect(
				status().isOk()).andExpect(jsonPath("$.content", Matchers.hasSize(2))).andExpect(
				jsonPath("$.content[*].executionCount", contains(2, 1))).andExpect(
				jsonPath("$.content[*].launchable", contains(false, true))).andExpect(
				jsonPath("$.content[*].deployed", contains(true, true))).andExpect(
				jsonPath("$.content[*].incrementable", contains(false, true))).andExpect(
				jsonPath("$.content[*].jobInstanceId", contains(nullValue(), nullValue()))).andExpect(
				jsonPath("$.content[*].duration", contains(info.getDuration(), null))).andExpect(
				jsonPath("$.content[*].startTime", contains(info.getStartTime(), null))).andExpect(
				jsonPath("$.content[*].startDate", contains(info.getStartDate(), null))).andExpect(
				jsonPath("$.content[*].stepExecutionCount", contains(info.getStepExecutionCount(), 0))).andExpect(
				jsonPath("$.content[*].jobParameters", contains(info.getJobParametersString(), null)))

				// should contain the display name (ie- without the .job suffix)
				.andExpect(jsonPath("$.content[0].name", equalTo("job1"))).andExpect(
						jsonPath("$.content[0].jobInstanceId", nullValue()))

				.andExpect(jsonPath("$.content[1].name", equalTo("job2"))).andExpect(
						jsonPath("$.content[1].jobInstanceId", nullValue()))

				// exit status is non null for job 0 and null for job 1
				.andExpect(
						jsonPath("$.content[0].exitStatus.exitDescription",
								equalTo(execution.getExitStatus().getExitDescription()))).andExpect(
						jsonPath("$.content[0].exitStatus.exitCode", equalTo(execution.getExitStatus().getExitCode()))).andExpect(
						jsonPath("$.content[0].exitStatus.running", equalTo(false))).andExpect(
						jsonPath("$.content[1].exitStatus", nullValue()));
	}
Tests REST compliance of {@link BatchJobsController} endpoints.

@author Ilayaperumal Gopinathan
@author Gunnar Hillert
spring-xd-dirt/src/test/java/org/springframework/xd/dirt/rest/BatchJobsControllerIntegrationTests.java