From 05c3666fad8665e27ac636b9cc0fa1dd258998f5 Mon Sep 17 00:00:00 2001 From: DongNyoung Lee <121621378+Dongnyoung@users.noreply.github.com> Date: Tue, 6 May 2025 20:12:36 +0900 Subject: [PATCH 1/3] Fix grammatical error in JavaDoc of setResponse method in MockClientHttpRequest This pull request fixes a grammatical mistake in the JavaDoc of the setResponse method in MockClientHttpRequest. - Original: "the this request" - Changed to: "this request" This change improves the clarity and quality of the documentation. Signed-off-by: DongNyoung Lee <121621378+Dongnyoung@users.noreply.github.com> --- .../springframework/mock/http/client/MockClientHttpRequest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-test/src/main/java/org/springframework/mock/http/client/MockClientHttpRequest.java b/spring-test/src/main/java/org/springframework/mock/http/client/MockClientHttpRequest.java index 42222f449375..5c2c8c3229da 100644 --- a/spring-test/src/main/java/org/springframework/mock/http/client/MockClientHttpRequest.java +++ b/spring-test/src/main/java/org/springframework/mock/http/client/MockClientHttpRequest.java @@ -104,7 +104,7 @@ public URI getURI() { /** * Set the {@link ClientHttpResponse} to be used as the result of executing - * the this request. + * this request. * @see #execute() */ public void setResponse(ClientHttpResponse clientHttpResponse) { From fedfc7ccf00037a3bc40c87b70edc7d009bb235a Mon Sep 17 00:00:00 2001 From: DongNyoung Lee <121621378+Dongnyoung@users.noreply.github.com> Date: Wed, 10 Sep 2025 22:07:47 +0900 Subject: [PATCH 2/3] Update MediaType.java Signed-off-by: DongNyoung Lee <121621378+Dongnyoung@users.noreply.github.com> --- .../src/main/java/org/springframework/http/MediaType.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/spring-web/src/main/java/org/springframework/http/MediaType.java b/spring-web/src/main/java/org/springframework/http/MediaType.java index 0ae9fb797dcf..206cd603052b 100644 --- a/spring-web/src/main/java/org/springframework/http/MediaType.java +++ b/spring-web/src/main/java/org/springframework/http/MediaType.java @@ -270,7 +270,12 @@ public class MediaType extends MimeType implements Serializable { * A String equivalent of {@link MediaType#IMAGE_PNG}. */ public static final String IMAGE_PNG_VALUE = "image/png"; - + + /** + * A String equivalent of {@link MediaType#IMAGE_WEBP}. + */ + public static final String IMAGE_WEBP_VALUE = "image/webp"; + /** * Media type for {@code multipart/form-data}. */ @@ -384,6 +389,7 @@ public class MediaType extends MimeType implements Serializable { IMAGE_GIF = new MediaType("image", "gif"); IMAGE_JPEG = new MediaType("image", "jpeg"); IMAGE_PNG = new MediaType("image", "png"); + IMAGE_WEBP = new MediaType("image", "webp"); MULTIPART_FORM_DATA = new MediaType("multipart", "form-data"); MULTIPART_MIXED = new MediaType("multipart", "mixed"); MULTIPART_RELATED = new MediaType("multipart", "related"); From 0557de4acc8d9a011970a2b057e3dd4b3480fb42 Mon Sep 17 00:00:00 2001 From: DongNyoung Lee <121621378+Dongnyoung@users.noreply.github.com> Date: Wed, 10 Sep 2025 22:41:51 +0900 Subject: [PATCH 3/3] Update MediaTypeTests.java Signed-off-by: DongNyoung Lee <121621378+Dongnyoung@users.noreply.github.com> --- .../test/java/org/springframework/http/MediaTypeTests.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/spring-web/src/test/java/org/springframework/http/MediaTypeTests.java b/spring-web/src/test/java/org/springframework/http/MediaTypeTests.java index 8ec8ae00b3d1..5566e61e31a8 100644 --- a/spring-web/src/test/java/org/springframework/http/MediaTypeTests.java +++ b/spring-web/src/test/java/org/springframework/http/MediaTypeTests.java @@ -74,6 +74,12 @@ void parseMediaType() { assertThat(mediaType.getSubtype()).as("Invalid subtype").isEqualTo("*"); assertThat(mediaType.getQualityValue()).as("Invalid quality factor").isCloseTo(0.2D, within(0D)); } + + @Test + void imageWebpConstants() { + assertThat(MediaType.IMAGE_WEBP_VALUE).isEqualTo("image/webp"); + assertThat(MediaType.IMAGE_WEBP).isEqualTo(new MediaType("image", "webp")); + } @Test void parseMediaTypeNoSubtype() {