@Test
void matchAppAndErrorCode() {

    var matcher = new AlertMatcher(List.of(
            matcher(List.of("website", "backoffice"), List.of("PATH_NOT_FOUND"), null, List.of()),
            matcher(List.of("frontend-website"), List.of("API_ERROR_401", "FORBIDDEN"), null, List.of()),
            matcher(List.of(), List.of("VALIDATION_ERROR"), null, List.of()), // match all apps if apps is empty
            matcher(List.of(), List.of("UNAUTHORIZED"), null, List.of())
    ));
    assertThat(matcher.matches(alert("website", "PATH_NOT_FOUND", Severity.WARN, "trace"))).isTrue();
    assertThat(matcher.matches(alert("frontend-website", "FORBIDDEN", Severity.WARN, "trace"))).isTrue();
    assertThat(matcher.matches(alert("customer-service", "FORBIDDEN", Severity.WARN, "trace"))).isFalse();
    assertThat(matcher.matches(alert("website", "METHOD_NOT_ALLOWED", Severity.WARN, "trace"))).isFalse();
    assertThat(matcher.matches(alert("customer-service", "VALIDATION_ERROR", Severity.WARN, "trace"))).isTrue();
    assertThat(matcher.matches(alert("customer-service", "UNAUTHORIZED", Severity.WARN, "trace"))).isTrue();
}