@Test
public void test_addAlarm() throws Exception{

    Alarm alarm = getAlarm("test");
    alarm.setGraphiteBaseUrl(new URI("graphiteUrl"));
    when(alarmService.subscribeToAAlarm(anyObject())).thenReturn(alarm);
    mockMvc.perform(post("/alarms")
        .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("$",is("test")));
}