public static void sendRedirectResponse(ResponseHandler handler, List<Cookie> cookies, String location) {
        Response response = createResponse(Response.Status.FOUND, cookies);
        response.headers().add("Location", location);
        handler.handleResponse(response).close(null);
    }
@Test
    void redirect_test() {
        RequestHandlerTestDriver.MockResponseHandler responseHandler = new RequestHandlerTestDriver.MockResponseHandler();

        String location = "http://domain.tld/path?query";
        sendRedirectResponse(responseHandler, cookies, location);
        assertEquals(302, responseHandler.getStatus());
        assertHeaders(responseHandler.getResponse(), Map.entry("Location", location), Map.entry("Set-Cookie", "my-cookie=value1"), Map.entry("Set-Cookie", "second-cookie=value2"));
    }