|
|
|
@ -41,11 +41,12 @@ public class NestedRouteIntegrationTests extends AbstractRouterFunctionIntegrati |
|
|
|
protected RouterFunction<?> routerFunction() { |
|
|
|
protected RouterFunction<?> routerFunction() { |
|
|
|
NestedHandler nestedHandler = new NestedHandler(); |
|
|
|
NestedHandler nestedHandler = new NestedHandler(); |
|
|
|
return nest(path("/foo/"), |
|
|
|
return nest(path("/foo/"), |
|
|
|
route(GET("/bar"), nestedHandler::bar) |
|
|
|
route(GET("/bar"), nestedHandler::bar) |
|
|
|
.andRoute(GET("/baz"), nestedHandler::baz)) |
|
|
|
.andRoute(GET("/baz"), nestedHandler::baz)) |
|
|
|
.andNest(GET("/{foo}"), |
|
|
|
.andNest(GET("/{foo}"), |
|
|
|
nest(GET("/{bar}"), |
|
|
|
route(GET("/bar"), nestedHandler::variables).and( |
|
|
|
route(GET("/{baz}"), nestedHandler::variables))) |
|
|
|
nest(GET("/{bar}"), |
|
|
|
|
|
|
|
route(GET("/{baz}"), nestedHandler::variables)))) |
|
|
|
.andRoute(GET("/{qux}/quux"), nestedHandler::variables); |
|
|
|
.andRoute(GET("/{qux}/quux"), nestedHandler::variables); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -77,6 +78,17 @@ public class NestedRouteIntegrationTests extends AbstractRouterFunctionIntegrati |
|
|
|
assertEquals("{foo=1, bar=2, baz=3}", result.getBody()); |
|
|
|
assertEquals("{foo=1, bar=2, baz=3}", result.getBody()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// SPR-16868
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
|
|
|
public void parentVariables() throws Exception { |
|
|
|
|
|
|
|
ResponseEntity<String> result = |
|
|
|
|
|
|
|
restTemplate.getForEntity("http://localhost:" + port + "/1/bar", String.class); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assertEquals(HttpStatus.OK, result.getStatusCode()); |
|
|
|
|
|
|
|
assertEquals("{foo=1}", result.getBody()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// SPR 16692
|
|
|
|
// SPR 16692
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
public void removeFailedPathVariables() throws Exception { |
|
|
|
public void removeFailedPathVariables() throws Exception { |
|
|
|
|