@Test
	public void testJobThatAlreadyExistsInJobRepo() throws Exception {
		when(jobLocator.getJobNames()).thenReturn(Arrays.asList(new String[] {"mydupejob"}));
		mockMvc.perform(
				post("/jobs/definitions").param("name", "mydupejob").param("definition", "job adsfa").accept(
						MediaType.APPLICATION_JSON))
				.andExpect(status().isBadRequest()).andExpect(
				jsonPath("$[0].message", Matchers.is("Batch Job with the name mydupejob already exists")));
	}
Tests REST compliance of jobs-related endpoints.

@author Glenn Renfro
@author Ilayaperumal Gopinathan
@author Mark Fisher
@author Florent Biville
spring-xd-dirt/src/test/java/org/springframework/xd/dirt/rest/JobsControllerIntegrationTests.java