=htp #21009 Correct type of response in logging directive samples (#21010)

* Correct type of response in logging directive samples #21009

* Updates to signatures in the docs as well
This commit is contained in:
Johan Andrén 2016-07-22 13:12:33 +02:00 committed by Konrad Malawski
parent 6fb2d176a1
commit 27efafecfc
4 changed files with 22 additions and 23 deletions

View file

@ -48,7 +48,7 @@ public class DebuggingDirectivesExamplesTest extends JUnitRouteTest {
// logs just the request method at info level
Function<HttpRequest, LogEntry> requestMethodAsInfo = (request) ->
LogEntry.create(request.method().toString(), InfoLevel());
LogEntry.create(request.method().name(), InfoLevel());
final Route routeUsingFunction = get(() ->
logRequest(requestMethodAsInfo, () -> complete("logged")));
@ -70,7 +70,7 @@ public class DebuggingDirectivesExamplesTest extends JUnitRouteTest {
(response.status().isSuccess()) ?
Optional.of(
LogEntry.create(
request.method().toString() + ":" + response.status().intValue(),
request.method().name() + ":" + response.status().intValue(),
InfoLevel()))
: Optional.empty(); // not a successful response
@ -80,7 +80,7 @@ public class DebuggingDirectivesExamplesTest extends JUnitRouteTest {
(!rejections.isEmpty()) ?
Optional.of(
LogEntry.create(
rejections
rejections
.stream()
.map(Rejection::toString)
.collect(Collectors.joining(", ")),
@ -116,7 +116,7 @@ public class DebuggingDirectivesExamplesTest extends JUnitRouteTest {
LogEntry.create(
rejections
.stream()
.map(rejection->rejection.toString())
.map(rejection -> rejection.toString())
.collect(Collectors.joining(", ")),
InfoLevel());