Rename RouterFunctions.subroute() to nest()
This commit renames the `RouterFunctions.subroute()` method to `nest()`, to better represent what it does. Issue: SPR-14954
This commit is contained in:
@@ -30,8 +30,11 @@ import org.springframework.mock.http.server.reactive.test.MockServerHttpResponse
|
||||
import org.springframework.web.reactive.result.view.ViewResolver;
|
||||
import org.springframework.web.server.ServerWebExchange;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.mockito.Mockito.*;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.mockito.Mockito.any;
|
||||
import static org.mockito.Mockito.eq;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
/**
|
||||
* @author Arjen Poutsma
|
||||
@@ -77,7 +80,7 @@ public class RouterFunctionsTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void subrouteMatch() throws Exception {
|
||||
public void nestMatch() throws Exception {
|
||||
HandlerFunction<ServerResponse> handlerFunction = request -> ServerResponse.ok().build();
|
||||
RouterFunction<ServerResponse> routerFunction = request -> Mono.just(handlerFunction);
|
||||
|
||||
@@ -85,7 +88,7 @@ public class RouterFunctionsTests {
|
||||
RequestPredicate requestPredicate = mock(RequestPredicate.class);
|
||||
when(requestPredicate.test(request)).thenReturn(true);
|
||||
|
||||
RouterFunction<ServerResponse> result = RouterFunctions.subroute(requestPredicate, routerFunction);
|
||||
RouterFunction<ServerResponse> result = RouterFunctions.nest(requestPredicate, routerFunction);
|
||||
assertNotNull(result);
|
||||
|
||||
Mono<HandlerFunction<ServerResponse>> resultHandlerFunction = result.route(request);
|
||||
@@ -96,7 +99,7 @@ public class RouterFunctionsTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void subrouteNoMatch() throws Exception {
|
||||
public void nestNoMatch() throws Exception {
|
||||
HandlerFunction<ServerResponse> handlerFunction = request -> ServerResponse.ok().build();
|
||||
RouterFunction<ServerResponse> routerFunction = request -> Mono.just(handlerFunction);
|
||||
|
||||
@@ -104,7 +107,7 @@ public class RouterFunctionsTests {
|
||||
RequestPredicate requestPredicate = mock(RequestPredicate.class);
|
||||
when(requestPredicate.test(request)).thenReturn(false);
|
||||
|
||||
RouterFunction<ServerResponse> result = RouterFunctions.subroute(requestPredicate, routerFunction);
|
||||
RouterFunction<ServerResponse> result = RouterFunctions.nest(requestPredicate, routerFunction);
|
||||
assertNotNull(result);
|
||||
|
||||
Mono<HandlerFunction<ServerResponse>> resultHandlerFunction = result.route(request);
|
||||
|
||||
Reference in New Issue
Block a user