Skip to content

Commit 3922f6f

Browse files
committed
Update references to RFC 2616
Replace references to the old RFC 2616 (HTTP 1.1) with references to the new RFCs 7230 to 7235. This commit also deprecates: - HttpStatus.USE_PROXY - HttpStatus.REQUEST_ENTITY_TOO_LARGE in favor of HttpStatus.PAYLOAD_TOO_LARGE - HttpStatus.REQUEST_URI_TOO_LONG in favor of HttpStatus.URI_TOO_LONG Issue: SPR-12067
1 parent 095bd99 commit 3922f6f

File tree

9 files changed

+116
-65
lines changed

9 files changed

+116
-65
lines changed

spring-core/src/main/java/org/springframework/util/MimeTypeUtils.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2013 the original author or authors.
2+
* Copyright 2002-2014 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -309,8 +309,8 @@ public static String toString(Collection<? extends MimeType> mimeTypes) {
309309
* <blockquote>audio/basic == text/html</blockquote> <blockquote>audio/basic ==
310310
* audio/wave</blockquote>
311311
* @param mimeTypes the list of mime types to be sorted
312-
* @see <a href="http://tools.ietf.org/html/rfc2616#section-14.1">HTTP 1.1, section
313-
* 14.1</a>
312+
* @see <a href="http://tools.ietf.org/html/rfc7231#section-5.3.2">HTTP 1.1: Semantics
313+
* and Content, section 5.3.2</a>
314314
*/
315315
public static void sortBySpecificity(List<MimeType> mimeTypes) {
316316
Assert.notNull(mimeTypes, "'mimeTypes' must not be null");

spring-test/src/main/java/org/springframework/test/web/servlet/result/StatusResultMatchers.java

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
*
3030
* @author Keesun Baik
3131
* @author Rossen Stoyanchev
32+
* @author Sebastien Deleuze
3233
* @since 3.2
3334
*/
3435
public class StatusResultMatchers {
@@ -283,7 +284,7 @@ public ResultMatcher isFound() {
283284
* Assert the response status code is {@code HttpStatus.MOVED_TEMPORARILY} (302).
284285
* @see #isFound()
285286
*/
286-
@SuppressWarnings("deprecation")
287+
@Deprecated
287288
public ResultMatcher isMovedTemporarily() {
288289
return matcher(HttpStatus.MOVED_TEMPORARILY);
289290
}
@@ -304,7 +305,9 @@ public ResultMatcher isNotModified() {
304305

305306
/**
306307
* Assert the response status code is {@code HttpStatus.USE_PROXY} (305).
308+
* @deprecated matching the deprecation of {@code HttpStatus.USE_PROXY}
307309
*/
310+
@Deprecated
308311
public ResultMatcher isUseProxy() {
309312
return matcher(HttpStatus.USE_PROXY);
310313
}
@@ -414,16 +417,38 @@ public ResultMatcher isPreconditionFailed() {
414417
return matcher(HttpStatus.PRECONDITION_FAILED);
415418
}
416419

420+
/**
421+
* Assert the response status code is {@code HttpStatus.PAYLOAD_TOO_LARGE} (413).
422+
* @since 4.1
423+
*/
424+
public ResultMatcher isPayloadTooLarge() {
425+
return matcher(HttpStatus.PAYLOAD_TOO_LARGE);
426+
}
427+
417428
/**
418429
* Assert the response status code is {@code HttpStatus.REQUEST_ENTITY_TOO_LARGE} (413).
430+
* @deprecated matching the deprecation of {@code HttpStatus.REQUEST_ENTITY_TOO_LARGE}
431+
* @see #isPayloadTooLarge()
419432
*/
433+
@Deprecated
420434
public ResultMatcher isRequestEntityTooLarge() {
421435
return matcher(HttpStatus.REQUEST_ENTITY_TOO_LARGE);
422436
}
423437

424438
/**
425439
* Assert the response status code is {@code HttpStatus.REQUEST_URI_TOO_LONG} (414).
440+
* @since 4.1
441+
*/
442+
public ResultMatcher isUriTooLong() {
443+
return matcher(HttpStatus.URI_TOO_LONG);
444+
}
445+
446+
/**
447+
* Assert the response status code is {@code HttpStatus.REQUEST_URI_TOO_LONG} (414).
448+
* @deprecated matching the deprecation of {@code HttpStatus.REQUEST_URI_TOO_LONG}
449+
* @see #isUriTooLong()
426450
*/
451+
@Deprecated
427452
public ResultMatcher isRequestUriTooLong() {
428453
return matcher(HttpStatus.REQUEST_URI_TOO_LONG);
429454
}
@@ -458,7 +483,7 @@ public ResultMatcher isIAmATeapot() {
458483

459484
/**
460485
* Assert the response status code is {@code HttpStatus.INSUFFICIENT_SPACE_ON_RESOURCE} (419).
461-
* @deprecated matching the deprecation of HttpStatus.INSUFFICIENT_SPACE_ON_RESOURCE
486+
* @deprecated matching the deprecation of {@code HttpStatus.INSUFFICIENT_SPACE_ON_RESOURCE}
462487
*/
463488
@Deprecated
464489
public ResultMatcher isInsufficientSpaceOnResource() {
@@ -467,7 +492,7 @@ public ResultMatcher isInsufficientSpaceOnResource() {
467492

468493
/**
469494
* Assert the response status code is {@code HttpStatus.METHOD_FAILURE} (420).
470-
* @deprecated matching the deprecation of HttpStatus.METHOD_FAILURE
495+
* @deprecated matching the deprecation of {@code HttpStatus.METHOD_FAILURE}
471496
*/
472497
@Deprecated
473498
public ResultMatcher isMethodFailure() {
@@ -476,7 +501,7 @@ public ResultMatcher isMethodFailure() {
476501

477502
/**
478503
* Assert the response status code is {@code HttpStatus.DESTINATION_LOCKED} (421).
479-
* @deprecated matching the deprecation of HttpStatus.DESTINATION_LOCKED
504+
* @deprecated matching the deprecation of {@code HttpStatus.DESTINATION_LOCKED}
480505
*/
481506
@Deprecated
482507
public ResultMatcher isDestinationLocked() {

0 commit comments

Comments
 (0)