Separate forwarded~ and redirectedUrlTemplate methods

This commit restores and existing redirectedUrl and forwardedUrl
methods (simple String comparison) and creates separate
redirectedUrlTemplate and forwardedUrlTemplate methods that expand
and also encode before comparing.

Issue: SPR-15834
This commit is contained in:
Rossen Stoyanchev
2017-08-15 15:25:39 +02:00
parent 8bdaba913c
commit 9c3bd8ce85
2 changed files with 26 additions and 8 deletions

View File

@@ -38,7 +38,7 @@ public class MockMvcResultMatchersTests {
@Test
public void redirectWithUrlTemplate() throws Exception {
redirectedUrl("/orders/{orderId}/items/{itemId}", 1, 2).match(getRedirectedUrlStubMvcResult("/orders/1/items/2"));
redirectedUrlTemplate("/orders/{orderId}/items/{itemId}", 1, 2).match(getRedirectedUrlStubMvcResult("/orders/1/items/2"));
}
@Test
@@ -63,7 +63,7 @@ public class MockMvcResultMatchersTests {
@Test
public void forwardWithUrlTemplate() throws Exception {
forwardedUrl("/orders/{orderId}/items/{itemId}", 1, 2).match(getForwardedUrlStubMvcResult("/orders/1/items/2"));
forwardedUrlTemplate("/orders/{orderId}/items/{itemId}", 1, 2).match(getForwardedUrlStubMvcResult("/orders/1/items/2"));
}
@Test