use of org.graylog2.rest.models.alarmcallbacks.AlarmCallbackError in project graylog2-server by Graylog2.
the class AlarmCallbackHistoryServiceImplTest method testError.
@Test
public void testError() throws Exception {
final AlarmCallbackConfiguration alarmCallbackConfiguration = mockAlarmCallbackConfiguration(new Date());
final Alert alert = mockAlert();
final AlertCondition alertCondition = mockAlertCondition();
final String errorMessage = "Dummy Error Message";
final AlarmCallbackHistory alarmCallbackHistory = this.alarmCallbackHistoryService.error(alarmCallbackConfiguration, alert, alertCondition, errorMessage);
verifyAlarmCallbackHistory(alarmCallbackHistory, alert, alertCondition);
assertThat(alarmCallbackHistory.result()).isNotNull().isInstanceOf(AlarmCallbackError.class);
assertThat(alarmCallbackHistory.result().type()).isEqualTo("error");
final AlarmCallbackError result = (AlarmCallbackError) alarmCallbackHistory.result();
assertThat(result.error()).isEqualTo(errorMessage);
}
Aggregations