ToStringVisitor consistently returns platform-independent line breaks

Issue: SPR-17322
This commit is contained in:
Juergen Hoeller
2018-11-22 16:11:59 +01:00
parent 17b2b8af86
commit b1b28d4641
2 changed files with 16 additions and 24 deletions

View File

@@ -23,14 +23,8 @@ import org.springframework.http.HttpMethod;
import org.springframework.http.MediaType;
import static org.junit.Assert.*;
import static org.springframework.web.reactive.function.server.RequestPredicates.accept;
import static org.springframework.web.reactive.function.server.RequestPredicates.contentType;
import static org.springframework.web.reactive.function.server.RequestPredicates.method;
import static org.springframework.web.reactive.function.server.RequestPredicates.methods;
import static org.springframework.web.reactive.function.server.RequestPredicates.path;
import static org.springframework.web.reactive.function.server.RequestPredicates.pathExtension;
import static org.springframework.web.reactive.function.server.RequestPredicates.queryParam;
import static org.springframework.web.reactive.function.server.RouterFunctions.route;
import static org.springframework.web.reactive.function.server.RequestPredicates.*;
import static org.springframework.web.reactive.function.server.RouterFunctions.*;
/**
* @author Arjen Poutsma
@@ -50,7 +44,7 @@ public class ToStringVisitorTests {
ToStringVisitor visitor = new ToStringVisitor();
routerFunction.accept(visitor);
String result = visitor.toString();
String result = visitor.toString();
String expected = "/foo => {\n" +
" /bar => {\n" +
@@ -91,6 +85,7 @@ public class ToStringVisitorTests {
assertEquals(expected, result);
}
private static class SimpleHandlerFunction implements HandlerFunction<ServerResponse> {
@Override
@@ -104,4 +99,4 @@ public class ToStringVisitorTests {
}
}
}
}