@Override
    protected Optional<ErrorResponse> filter(DiscFilterRequest request) {
        String method = request.getMethod();
        URI uri = request.getUri();
        for (Rule rule : rules) {
            if (rule.matches(method, uri)) {
                log.log(Level.FINE, () ->
                        String.format("Request '%h' with method '%s' and uri '%s' matched rule '%s'", request, method, uri, rule.name));
                return responseFor(request, rule.name, rule.response);
            }
        }
        return responseFor(request, "default", defaultResponse);
    }
@Test
    void dryrun_does_not_block() {
        RuleBasedFilterConfig config = new RuleBasedFilterConfig.Builder()
                .dryrun(true)
                .defaultRule(new DefaultRule.Builder()
                        .action(DefaultRule.Action.Enum.BLOCK))
                .build();

        Metric metric = mock(Metric.class);
        RuleBasedRequestFilter filter = new RuleBasedRequestFilter(metric, config);
        MockResponseHandler responseHandler = new MockResponseHandler();
        filter.filter(request("GET", "http://myserver/"), responseHandler);
        assertNull(responseHandler.getResponse());
    }