Search in sources :

Example 1 with EmailEventNotificationConfig

use of org.graylog.events.notifications.types.EmailEventNotificationConfig in project graylog2-server by Graylog2.

the class NotificationDtoTest method testValidateEmailWithEmptyConfigParameters.

@Test
public void testValidateEmailWithEmptyConfigParameters() {
    final EmailEventNotificationConfig emptyConfig = EmailEventNotificationConfig.Builder.create().sender("").subject("").bodyTemplate("").htmlBodyTemplate("").build();
    final NotificationDto emptyNotification = getEmailNotification().toBuilder().config(emptyConfig).build();
    final ValidationResult validationResult = emptyNotification.validate();
    assertThat(validationResult.failed()).isTrue();
    assertThat(validationResult.getErrors().size()).isEqualTo(3);
    assertThat(validationResult.getErrors()).containsOnlyKeys("subject", "body", "recipients");
}
Also used : EmailEventNotificationConfig(org.graylog.events.notifications.types.EmailEventNotificationConfig) ValidationResult(org.graylog2.plugin.rest.ValidationResult) Test(org.junit.Test)

Aggregations

EmailEventNotificationConfig (org.graylog.events.notifications.types.EmailEventNotificationConfig)1 ValidationResult (org.graylog2.plugin.rest.ValidationResult)1 Test (org.junit.Test)1