diff --git a/spring-5-reactive/src/main/java/com/baeldung/reactive/filter/ExampleHandlerFilterFunction.java b/spring-5-reactive/src/main/java/com/baeldung/reactive/filters/ExampleHandlerFilterFunction.java similarity index 77% rename from spring-5-reactive/src/main/java/com/baeldung/reactive/filter/ExampleHandlerFilterFunction.java rename to spring-5-reactive/src/main/java/com/baeldung/reactive/filters/ExampleHandlerFilterFunction.java index e55f5ce2fe..36b3c2ff6e 100644 --- a/spring-5-reactive/src/main/java/com/baeldung/reactive/filter/ExampleHandlerFilterFunction.java +++ b/spring-5-reactive/src/main/java/com/baeldung/reactive/filters/ExampleHandlerFilterFunction.java @@ -1,4 +1,4 @@ -package com.baeldung.reactive.filter; +package com.baeldung.reactive.filters; import org.springframework.web.reactive.function.server.HandlerFilterFunction; import org.springframework.web.reactive.function.server.HandlerFunction; @@ -8,10 +8,10 @@ import reactor.core.publisher.Mono; import static org.springframework.http.HttpStatus.FORBIDDEN; -public class ExampleHandlerFilterFunction implements HandlerFilterFunction { +public class ExampleHandlerFilterFunction implements HandlerFilterFunction { @Override - public Mono filter(ServerRequest serverRequest, HandlerFunction handlerFunction) { + public Mono filter(ServerRequest serverRequest, HandlerFunction handlerFunction) { if (serverRequest.pathVariable("name").equalsIgnoreCase("test")) { return ServerResponse.status(FORBIDDEN).build(); } diff --git a/spring-5-reactive/src/main/java/com/baeldung/reactive/filter/ExampleWebFilter.java b/spring-5-reactive/src/main/java/com/baeldung/reactive/filters/ExampleWebFilter.java similarity index 93% rename from spring-5-reactive/src/main/java/com/baeldung/reactive/filter/ExampleWebFilter.java rename to spring-5-reactive/src/main/java/com/baeldung/reactive/filters/ExampleWebFilter.java index 99bc9f7fc3..8fe3550a7e 100644 --- a/spring-5-reactive/src/main/java/com/baeldung/reactive/filter/ExampleWebFilter.java +++ b/spring-5-reactive/src/main/java/com/baeldung/reactive/filters/ExampleWebFilter.java @@ -1,4 +1,4 @@ -package com.baeldung.reactive.filter; +package com.baeldung.reactive.filters; import org.springframework.stereotype.Component; import org.springframework.web.server.ServerWebExchange; diff --git a/spring-5-reactive/src/main/java/com/baeldung/reactive/handler/PlayerHandler.java b/spring-5-reactive/src/main/java/com/baeldung/reactive/filters/PlayerHandler.java similarity index 77% rename from spring-5-reactive/src/main/java/com/baeldung/reactive/handler/PlayerHandler.java rename to spring-5-reactive/src/main/java/com/baeldung/reactive/filters/PlayerHandler.java index 51b4e166d1..20a08570ae 100644 --- a/spring-5-reactive/src/main/java/com/baeldung/reactive/handler/PlayerHandler.java +++ b/spring-5-reactive/src/main/java/com/baeldung/reactive/filters/PlayerHandler.java @@ -1,4 +1,4 @@ -package com.baeldung.reactive.handler; +package com.baeldung.reactive.filters; import org.springframework.stereotype.Component; import org.springframework.web.reactive.function.server.ServerRequest; @@ -8,9 +8,9 @@ import reactor.core.publisher.Mono; import static org.springframework.web.reactive.function.server.ServerResponse.ok; @Component -public class PlayerHandler { +class PlayerHandler { - public Mono getName(ServerRequest request) { + Mono getName(ServerRequest request) { Mono name = Mono.just(request.pathVariable("name")); return ok().body(name, String.class); } diff --git a/spring-5-reactive/src/main/java/com/baeldung/reactive/router/PlayerRouter.java b/spring-5-reactive/src/main/java/com/baeldung/reactive/filters/PlayerRouter.java similarity index 74% rename from spring-5-reactive/src/main/java/com/baeldung/reactive/router/PlayerRouter.java rename to spring-5-reactive/src/main/java/com/baeldung/reactive/filters/PlayerRouter.java index be721964ca..753991782c 100644 --- a/spring-5-reactive/src/main/java/com/baeldung/reactive/router/PlayerRouter.java +++ b/spring-5-reactive/src/main/java/com/baeldung/reactive/filters/PlayerRouter.java @@ -1,7 +1,5 @@ -package com.baeldung.reactive.router; +package com.baeldung.reactive.filters; -import com.baeldung.reactive.filter.ExampleHandlerFilterFunction; -import com.baeldung.reactive.handler.PlayerHandler; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.web.reactive.function.server.RouterFunction; @@ -17,6 +15,6 @@ public class PlayerRouter { public RouterFunction route(PlayerHandler playerHandler) { return RouterFunctions .route(GET("/players/{name}"), playerHandler::getName) - .filter(new ExampleHandlerFilterFunction()::filter); + .filter(new ExampleHandlerFilterFunction()); } } diff --git a/spring-5-reactive/src/main/java/com/baeldung/reactive/controller/UserController.java b/spring-5-reactive/src/main/java/com/baeldung/reactive/filters/UserController.java similarity index 90% rename from spring-5-reactive/src/main/java/com/baeldung/reactive/controller/UserController.java rename to spring-5-reactive/src/main/java/com/baeldung/reactive/filters/UserController.java index f51a674fe8..38c9210f88 100644 --- a/spring-5-reactive/src/main/java/com/baeldung/reactive/controller/UserController.java +++ b/spring-5-reactive/src/main/java/com/baeldung/reactive/filters/UserController.java @@ -1,4 +1,4 @@ -package com.baeldung.reactive.controller; +package com.baeldung.reactive.filters; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; diff --git a/spring-5-reactive/src/test/java/com/baeldung/reactive/handler/PlayerHandlerTest.java b/spring-5-reactive/src/test/java/com/baeldung/reactive/filters/PlayerHandlerTest.java similarity index 97% rename from spring-5-reactive/src/test/java/com/baeldung/reactive/handler/PlayerHandlerTest.java rename to spring-5-reactive/src/test/java/com/baeldung/reactive/filters/PlayerHandlerTest.java index de9b326874..8189802248 100644 --- a/spring-5-reactive/src/test/java/com/baeldung/reactive/handler/PlayerHandlerTest.java +++ b/spring-5-reactive/src/test/java/com/baeldung/reactive/filters/PlayerHandlerTest.java @@ -1,4 +1,4 @@ -package com.baeldung.reactive.handler; +package com.baeldung.reactive.filters; import org.junit.Test; import org.junit.runner.RunWith; diff --git a/spring-5-reactive/src/test/java/com/baeldung/reactive/controller/UserControllerTest.java b/spring-5-reactive/src/test/java/com/baeldung/reactive/filters/UserControllerTest.java similarity index 96% rename from spring-5-reactive/src/test/java/com/baeldung/reactive/controller/UserControllerTest.java rename to spring-5-reactive/src/test/java/com/baeldung/reactive/filters/UserControllerTest.java index 131a3d812b..d32a9d478f 100644 --- a/spring-5-reactive/src/test/java/com/baeldung/reactive/controller/UserControllerTest.java +++ b/spring-5-reactive/src/test/java/com/baeldung/reactive/filters/UserControllerTest.java @@ -1,4 +1,4 @@ -package com.baeldung.reactive.controller; +package com.baeldung.reactive.filters; import org.junit.Test; import org.junit.runner.RunWith;