DefaultHttpResult implements HttpResult { public void movedPermanentlyTo(String uri) { this.status.movedPermanentlyTo(uri); } DefaultHttpResult(HttpServletResponse response, Status status); HttpResult addDateHeader(String name, long date); HttpResult addHeader(String name, String value); HttpResult addIntHeader(String name, int value); void sendError(int statusCode); void sendError(int statusCode, String message); void setStatusCode(int statusCode); void movedPermanentlyTo(String uri); T movedPermanentlyTo(final Class<T> controller); HttpResult body(String body); HttpResult body(InputStream body); HttpResult body(Reader body);  }
@SuppressWarnings("deprecation") @Test public void shouldDelegateToStatus() throws Exception { httpResult.movedPermanentlyTo("/my/uri"); verify(status).movedPermanentlyTo("/my/uri"); }
@SuppressWarnings("deprecation") @Test public void shouldDelegateToStatusWhenMovingToLogic() throws Exception { when(status.movedPermanentlyTo(RandomController.class)).thenReturn(new RandomController()); httpResult.movedPermanentlyTo(RandomController.class).method(); verify(status).movedPermanentlyTo(RandomController.class); }