@Test
public void shouldReturn404IfJobDefinitionIsUnknown() throws Exception {

    when(jobDefinitionService.getJobDefinition("FooJob")).thenReturn(Optional.empty());
    mockMvc.perform(get(MANAGEMENT_CONTEXT + "/jobdefinitions/FooJob"))
            .andExpect(status().is(404));
}