@Test
void message() {

    Alert alert = alert(Severity.WARN, "ERROR_CODE", "trace");
    alert.id = "id";
    alert.errorMessage = "message";
    alert.kibanaIndex = "action";
    assertThat(service.message(alert, 10)).isEqualTo("""
            *[10]* WARN: *site / website*
            _id: <http://kibana:5601/app/kibana#/doc/action-pattern/action-*?id=id&_g=()|id>
            error_code: *ERROR_CODE*
            message: message
            """);
    alert.host = "host";
    assertThat(service.message(alert, 0)).isEqualTo("""
            WARN: *site / website*
            host: host
            _id: <http://kibana:5601/app/kibana#/doc/action-pattern/action-*?id=id&_g=()|id>
            error_code: *ERROR_CODE*
            message: message
            """);
    alert.action = "action";
    alert.host = null;
    assertThat(service.message(alert, 0)).isEqualTo("""
            WARN: *site / website*
            _id: <http://kibana:5601/app/kibana#/doc/action-pattern/action-*?id=id&_g=()|id>
            action: action
            error_code: *ERROR_CODE*
            message: message
            """);
}
private Alert alert(Severity severity, String errorCode, String index) {
    var alert = new Alert();
    alert.app = "website";
    alert.severity = severity;
    alert.errorCode = errorCode;
    alert.kibanaIndex = index;
    return alert;
}