Renamed 'and' to 'andSame' and 'andOther' to 'and'
In RoutingFunction, renamed 'and' to 'andSame', and 'andOther' to 'and' to make the commonly used method name shorter.
This commit is contained in:
@@ -29,12 +29,12 @@ import static org.junit.Assert.*;
|
||||
public class RoutingFunctionTests {
|
||||
|
||||
@Test
|
||||
public void and() throws Exception {
|
||||
public void andSame() throws Exception {
|
||||
HandlerFunction<Void> handlerFunction = request -> Response.ok().build();
|
||||
RoutingFunction<Void> routingFunction1 = request -> Optional.empty();
|
||||
RoutingFunction<Void> routingFunction2 = request -> Optional.of(handlerFunction);
|
||||
|
||||
RoutingFunction<Void> result = routingFunction1.and(routingFunction2);
|
||||
RoutingFunction<Void> result = routingFunction1.andSame(routingFunction2);
|
||||
assertNotNull(result);
|
||||
|
||||
MockRequest request = MockRequest.builder().build();
|
||||
@@ -44,12 +44,12 @@ public class RoutingFunctionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void andOther() throws Exception {
|
||||
public void and() throws Exception {
|
||||
HandlerFunction<String> handlerFunction = request -> Response.ok().body("42");
|
||||
RoutingFunction<Void> routingFunction1 = request -> Optional.empty();
|
||||
RoutingFunction<String> routingFunction2 = request -> Optional.of(handlerFunction);
|
||||
|
||||
RoutingFunction<?> result = routingFunction1.andOther(routingFunction2);
|
||||
RoutingFunction<?> result = routingFunction1.and(routingFunction2);
|
||||
assertNotNull(result);
|
||||
|
||||
MockRequest request = MockRequest.builder().build();
|
||||
|
||||
@@ -51,8 +51,8 @@ public class SseHandlerFunctionIntegrationTests
|
||||
protected RoutingFunction<?> routingFunction() {
|
||||
SseHandler sseHandler = new SseHandler();
|
||||
return route(RequestPredicates.GET("/string"), sseHandler::string)
|
||||
.andOther(route(RequestPredicates.GET("/person"), sseHandler::person))
|
||||
.andOther(route(RequestPredicates.GET("/event"), sseHandler::sse));
|
||||
.and(route(RequestPredicates.GET("/person"), sseHandler::person))
|
||||
.and(route(RequestPredicates.GET("/event"), sseHandler::sse));
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user