diff --git a/.github/workflows/validate-and-test.yml b/.github/workflows/validate-and-test.yml index 306039039..c0f0c575e 100644 --- a/.github/workflows/validate-and-test.yml +++ b/.github/workflows/validate-and-test.yml @@ -36,7 +36,7 @@ jobs: key: build-target-${{ hashFiles('**/*.sbt', 'project/build.properties', 'project/**/*.scala') }} - name: Check code is formatted - run: sbt javafmtCheck + run: sbt javafmtCheckAll - name: Check for missing formatting run: git diff --exit-code --color diff --git a/docs/src/test/java/docs/http/javadsl/server/cors/CorsServerExample.java b/docs/src/test/java/docs/http/javadsl/server/cors/CorsServerExample.java index 79fa7774d..33755b19d 100644 --- a/docs/src/test/java/docs/http/javadsl/server/cors/CorsServerExample.java +++ b/docs/src/test/java/docs/http/javadsl/server/cors/CorsServerExample.java @@ -44,21 +44,20 @@ public static void main(String[] args) throws Exception { final CorsServerExample app = new CorsServerExample(); final CompletionStage futureBinding = - Http.get(system).newServerAt("localhost", 8080).bind(app.createRoute()); - - futureBinding.whenComplete((binding, exception) -> { - if (binding != null) { - system.log().info("Server online at http://localhost:8080/\nPress RETURN to stop..."); - } else { - system.log().error("Failed to bind HTTP endpoint, terminating system", exception); - system.terminate(); - } - }); + Http.get(system).newServerAt("localhost", 8080).bind(app.createRoute()); + + futureBinding.whenComplete( + (binding, exception) -> { + if (binding != null) { + system.log().info("Server online at http://localhost:8080/\nPress RETURN to stop..."); + } else { + system.log().error("Failed to bind HTTP endpoint, terminating system", exception); + system.terminate(); + } + }); System.in.read(); // let it run until user presses return - futureBinding - .thenCompose(ServerBinding::unbind) - .thenAccept(unbound -> system.terminate()); + futureBinding.thenCompose(ServerBinding::unbind).thenAccept(unbound -> system.terminate()); } private Route createRoute() { diff --git a/http-tests/src/test/java/org/apache/pekko/http/javadsl/server/JavaTestServer.java b/http-tests/src/test/java/org/apache/pekko/http/javadsl/server/JavaTestServer.java index c8fe7df07..457175fed 100644 --- a/http-tests/src/test/java/org/apache/pekko/http/javadsl/server/JavaTestServer.java +++ b/http-tests/src/test/java/org/apache/pekko/http/javadsl/server/JavaTestServer.java @@ -48,9 +48,8 @@ public Route createRoute() { timeout, this::mkTimeoutResponse, () -> { - silentSleep( - 5000); // too long, but note that this will NOT activate - // withRequestTimeout, see below + silentSleep(5000); // too long, but note that this will NOT activate + // withRequestTimeout, see below return complete(index()); })); diff --git a/http-tests/src/test/java/org/apache/pekko/http/javadsl/server/directives/RouteDirectivesTest.java b/http-tests/src/test/java/org/apache/pekko/http/javadsl/server/directives/RouteDirectivesTest.java index 94c886f4d..c42d74ecb 100644 --- a/http-tests/src/test/java/org/apache/pekko/http/javadsl/server/directives/RouteDirectivesTest.java +++ b/http-tests/src/test/java/org/apache/pekko/http/javadsl/server/directives/RouteDirectivesTest.java @@ -51,7 +51,7 @@ public void testEntitySizeNoLimit() { mat -> Directives.onSuccess( entity // fails to infer type parameter with some older - // oracle JDK versions + // oracle JDK versions .withoutSizeLimit() .getDataBytes() .runWith(Sink.head(), mat), @@ -74,7 +74,7 @@ private TestRoute routeWithLimit() { mat -> Directives.onSuccess( entity // fails to infer type parameter with some older oracle - // JDK versions + // JDK versions .withSizeLimit(5) .getDataBytes() .runWith(Sink.head(), mat),