### Question:
StaticContentHandler { static void redirect(ServerResponse response, String location) { response.status(Http.Status.MOVED_PERMANENTLY_301); response.headers().put(Http.Header.LOCATION, location); response.send(); } StaticContentHandler(String welcomeFilename, ContentTypeSelector contentTypeSelector);   }### Answer:
@Test public void redirect() throws Exception { ResponseHeaders resh = mock(ResponseHeaders.class); ServerResponse res = mock(ServerResponse.class); Mockito.doReturn(resh).when(res).headers(); StaticContentHandler.redirect(res, "/foo/"); verify(res).status(Http.Status.MOVED_PERMANENTLY_301); verify(resh).put(Http.Header.LOCATION, "/foo/"); verify(res).send(); }