@Test
public void subscribeAlarmWithSameName() throws Exception {

    Alarm alarm = new Alarm();
    alarm.setName(TestUtils.DEFAULT_ALARM_NAME);
    try {
        alarmService.subscribeToAAlarm(alarm);
        fail("Adding a alarm with same name");
    } catch (CerebroException ce) {
        assertEquals(ErrorCode.ALARM_DUPLICATE_NAME, ce.getErrorCode());
    }
}