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:
Arjen Poutsma
2016-09-12 15:02:12 +02:00
parent 96ec18a9aa
commit 61bf6a25b7
3 changed files with 11 additions and 11 deletions

View File

@@ -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();

View File

@@ -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));
}