@Test
public void test_all_withoutSubTarget() throws Exception{

    Collection<Alarm> alarms = new ArrayList<>();
    for(int i=0; i < 2; i++){
        alarms.add(getAlarm("id",i));
    }
    when(alarmMapper.mapToPresentation(anyCollection())).thenReturn(alarms);
    mockMvc.perform(get("/alarms")).andExpect(status().isOk())
        .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))
        .andExpect(jsonPath("$", hasSize(2)))
        .andExpect(jsonPath("$[0].id",is("id0")))
        .andExpect(jsonPath("$[0].name",is("name0")))
        .andExpect(jsonPath("$[0].target",is("target0")))
        .andExpect(jsonPath("$[1].id",is("id1")))
        .andExpect(jsonPath("$[1].name",is("name1")))
        .andExpect(jsonPath("$[1].target",is("target1")));
}