@Test
public void test_searchAlarm() throws Exception{

    Alarm alarm = getAlarm("test");
    alarm.setGraphiteBaseUrl(new URI("graphiteUrl"));
    when(alarmMapper.mapToPresentation((Alarm)anyObject())).thenReturn(alarm);
    mockMvc.perform(post("/alarms/search")
        .accept(MediaType.APPLICATION_JSON_UTF8_VALUE)
        .contentType(MediaType.APPLICATION_JSON_UTF8_VALUE)
        .content(new ObjectMapper().writeValueAsString(alarm))
    ).andExpect(status().isOk())
        .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))
        .andExpect(jsonPath("$.id",is("test")))
        .andExpect(jsonPath("$.name",is("name")))
        .andExpect(jsonPath("$.target",is("target")));
}