### Question:
RedirectBehavior implements Behavior { public void act(HttpServletRequest request, HttpServletResponse response) throws IOException { redirectStrategy.sendRedirect(request, response, redirectUrl); } RedirectBehavior(final String redirectUrl, final String name); void act(HttpServletRequest request, HttpServletResponse response); @Override boolean isCommitting(); @Override String name(); void setRedirectStrategy(RedirectStrategy redirectStrategy); @Override String toString();  }### Answer:
@Test void shouldRedirect() throws IOException { RedirectBehavior behavior = new RedirectBehavior("/error", "redirectToError"); behavior.act(request, response); assertEquals(SC_MOVED_TEMPORARILY, response.getStatus()); assertEquals("/error", response.getRedirectedUrl()); assertTrue(response.isCommitted()); }