UrlRewriter { public static HttpResponse redirect(Class<?> controller, String options, HttpResponseUtils.RedirectStatusCode code) { return builder(HttpResponse.of("")) .set(HttpResponse::setStatus, code.getStatusCode()) .set(HttpResponse::setHeaders, Headers.of("Location", urlFor(controller, options))) .build(); }  static RoutingGenerationContext urlFor(OptionMap options); static RoutingGenerationContext urlFor(Class<?> controller, String optionString); static HttpResponse redirect(Class<?> controller, String options, HttpResponseUtils.RedirectStatusCode code); @SuppressWarnings("unchecked") static OptionMap parseOptionString(Class<?> controller, String optionString);  }
@Test void redirect() { assertThat(UrlRewriter.redirect(FooController.class, "index?c=3", SEE_OTHER)) .is(new Condition<>(response -> response.getStatus() == 303 && response.getHeaders().containsKey("Location"), "Have a location header")); }