Skip to content

Commit 2cbd5ba

Browse files
committed
Clean up regarding deprecated HttpStatus.MOVED_TEMPORARILY
1 parent 3e21388 commit 2cbd5ba

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,7 @@ public ResultMatcher isFound() {
283283
/**
284284
* Assert the response status code is {@code HttpStatus.MOVED_TEMPORARILY} (302).
285285
* @see #isFound()
286+
* @deprecated in favor of {@link #isFound()}
286287
*/
287288
@Deprecated
288289
public ResultMatcher isMovedTemporarily() {

spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/FilterTests.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2012 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"); you may not use this file except in compliance with
55
* the License. You may obtain a copy of the License at
@@ -10,6 +10,7 @@
1010
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
1111
* specific language governing permissions and limitations under the License.
1212
*/
13+
1314
package org.springframework.test.web.servlet.samples.standalone;
1415

1516
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
@@ -53,7 +54,7 @@ public void whenFiltersCompleteMvcProcessesRequest() throws Exception {
5354
standaloneSetup(new PersonController())
5455
.addFilters(new ContinueFilter()).build()
5556
.perform(post("/persons").param("name", "Andy"))
56-
.andExpect(status().isMovedTemporarily())
57+
.andExpect(status().isFound())
5758
.andExpect(redirectedUrl("/person/1"))
5859
.andExpect(model().size(1))
5960
.andExpect(model().attributeExists("id"))
@@ -90,7 +91,7 @@ public void filterSkipped() throws Exception {
9091
standaloneSetup(new PersonController())
9192
.addFilter(new RedirectFilter(), "/p", "/person").build()
9293
.perform(post("/persons").param("name", "Andy"))
93-
.andExpect(status().isMovedTemporarily())
94+
.andExpect(status().isFound())
9495
.andExpect(redirectedUrl("/person/1"))
9596
.andExpect(model().size(1))
9697
.andExpect(model().attributeExists("id"))

spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/RedirectTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2012 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.
@@ -51,7 +51,7 @@ public void setup() {
5151
@Test
5252
public void save() throws Exception {
5353
this.mockMvc.perform(post("/persons").param("name", "Andy"))
54-
.andExpect(status().isMovedTemporarily())
54+
.andExpect(status().isFound())
5555
.andExpect(redirectedUrl("/persons/Joe"))
5656
.andExpect(model().size(1))
5757
.andExpect(model().attributeExists("name"))

spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/resultmatchers/FlashAttributeAssertionTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2012 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.
@@ -48,7 +48,7 @@ public class FlashAttributeAssertionTests {
4848
@Before
4949
public void setup() {
5050
this.mockMvc = standaloneSetup(new PersonController())
51-
.alwaysExpect(status().isMovedTemporarily())
51+
.alwaysExpect(status().isFound())
5252
.alwaysExpect(flash().attributeCount(3))
5353
.build();
5454
}

0 commit comments

Comments
 (0)