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()))