use of cn.taketoday.http.HttpStatus in project today-infrastructure by TAKETODAY.
the class RelativeRedirectFilterTests method doFilterSendRedirectWhenCustomSendRedirectHttpStatusThenLocationAnd301.
@Test
public void doFilterSendRedirectWhenCustomSendRedirectHttpStatusThenLocationAnd301() throws Exception {
String location = "/foo";
HttpStatus status = HttpStatus.MOVED_PERMANENTLY;
this.filter.setRedirectStatus(status);
sendRedirect(location);
InOrder inOrder = Mockito.inOrder(this.response);
inOrder.verify(this.response).setStatus(status.value());
inOrder.verify(this.response).setHeader(HttpHeaders.LOCATION, location);
}
use of cn.taketoday.http.HttpStatus in project today-framework by TAKETODAY.
the class ResponseStatusException method getMessage.
@Override
public String getMessage() {
HttpStatus code = HttpStatus.resolve(getRawStatusCode());
String msg = (code != null ? code : getRawStatusCode()) + (this.reason != null ? " \"" + this.reason + "\"" : "");
return ExceptionUtils.buildMessage(msg, getCause());
}
Aggregations