@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); }
public void movedPermanentlyTo(String uri) { this.status.movedPermanentlyTo(uri); }
DefaultHttpResult implements HttpResult { public void movedPermanentlyTo(String uri) { this.status.movedPermanentlyTo(uri); } }
DefaultHttpResult implements HttpResult { public void movedPermanentlyTo(String uri) { this.status.movedPermanentlyTo(uri); } DefaultHttpResult(HttpServletResponse response, Status status); }
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); }
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);  }