Add HttpClientErrorException.PreconditionFailed

Closes gh-36807

Signed-off-by: Dominik Kovács <dominik.kovacs28@gmail.com>
This commit is contained in:
Dominik Kovács
2026-07-29 15:50:38 +03:00
committed by rstoyanchev
parent 56f7cc2dab
commit dddd237449
2 changed files with 27 additions and 0 deletions
@@ -41,6 +41,7 @@ import static org.springframework.http.HttpStatus.BAD_REQUEST;
import static org.springframework.http.HttpStatus.CONFLICT;
import static org.springframework.http.HttpStatus.FORBIDDEN;
import static org.springframework.http.HttpStatus.GATEWAY_TIMEOUT;
import static org.springframework.http.HttpStatus.GONE;
import static org.springframework.http.HttpStatus.HTTP_VERSION_NOT_SUPPORTED;
import static org.springframework.http.HttpStatus.INTERNAL_SERVER_ERROR;
import static org.springframework.http.HttpStatus.I_AM_A_TEAPOT;
@@ -48,9 +49,12 @@ import static org.springframework.http.HttpStatus.METHOD_NOT_ALLOWED;
import static org.springframework.http.HttpStatus.NOT_ACCEPTABLE;
import static org.springframework.http.HttpStatus.NOT_FOUND;
import static org.springframework.http.HttpStatus.NOT_IMPLEMENTED;
import static org.springframework.http.HttpStatus.PRECONDITION_FAILED;
import static org.springframework.http.HttpStatus.UNSUPPORTED_MEDIA_TYPE;
import static org.springframework.http.HttpStatus.SERVICE_UNAVAILABLE;
import static org.springframework.http.HttpStatus.TOO_MANY_REQUESTS;
import static org.springframework.http.HttpStatus.UNAUTHORIZED;
import static org.springframework.http.HttpStatus.UNPROCESSABLE_CONTENT;
import static org.springframework.http.HttpStatus.UNPROCESSABLE_ENTITY;
/**
@@ -98,8 +102,12 @@ class DefaultResponseErrorHandlerHttpStatusTests {
args(METHOD_NOT_ALLOWED, HttpClientErrorException.MethodNotAllowed.class),
args(NOT_ACCEPTABLE, HttpClientErrorException.NotAcceptable.class),
args(CONFLICT, HttpClientErrorException.Conflict.class),
args(GONE, HttpClientErrorException.Gone.class),
args(PRECONDITION_FAILED, HttpClientErrorException.PreconditionFailed.class),
args(UNSUPPORTED_MEDIA_TYPE, HttpClientErrorException.UnsupportedMediaType.class),
args(TOO_MANY_REQUESTS, HttpClientErrorException.TooManyRequests.class),
args(UNPROCESSABLE_ENTITY, HttpClientErrorException.UnprocessableEntity.class),
args(UNPROCESSABLE_CONTENT, HttpClientErrorException.UnprocessableContent.class),
args(I_AM_A_TEAPOT, HttpClientErrorException.class),
// 5xx
args(INTERNAL_SERVER_ERROR, HttpServerErrorException.InternalServerError.class),