DefaultStatus implements Status { public void movedPermanentlyTo(String location) { this.response.setStatus(HttpServletResponse.SC_MOVED_PERMANENTLY); header("Location", fixLocation(location)); this.response.addIntHeader("Content-length", 0); this.response.addDateHeader("Date", System.currentTimeMillis()); } DefaultStatus(HttpServletResponse response, Result result, Configuration config,
			Proxifier proxifier, Router router); void notFound(); void header(String key, String value); void created(); void created(String location); void ok(); void conflict(); void methodNotAllowed(EnumSet<HttpMethod> allowedMethods); void movedPermanentlyTo(String location); T movedPermanentlyTo(final Class<T> controller); void unsupportedMediaType(String message); void badRequest(String message); void badRequest(List<?> errors); void forbidden(String message); void noContent(); void notAcceptable(); void accepted(); void notModified();  }
@Test public void shouldSetMovedPermanentlyStatus() throws Exception { when(config.getApplicationPath()).thenReturn("http: status.movedPermanentlyTo("/newURL"); verify(response).setStatus(301); verify(response).addHeader("Location", "http: }
@Test public void shouldMoveToExactlyURIWhenItIsNotAbsolute() throws Exception { status.movedPermanentlyTo("http: verify(response).addHeader("Location", "http: verify(response).setStatus(HttpServletResponse.SC_MOVED_PERMANENTLY); }
@Test public void shouldSetMovedPermanentlyStatusOfLogic() throws Exception { when(config.getApplicationPath()).thenReturn("http: Method method = Resource.class.getDeclaredMethod("method"); when(router.urlFor(eq(Resource.class), eq(method), Mockito.anyVararg())).thenReturn("/resource/method"); status.movedPermanentlyTo(Resource.class).method(); verify(response).setStatus(301); verify(response).addHeader("Location", "http: }