diff --git a/spring-5-reactive-2/README.md b/spring-5-reactive-2/README.md index 061c15b148..54f7ad35b1 100644 --- a/spring-5-reactive-2/README.md +++ b/spring-5-reactive-2/README.md @@ -8,5 +8,5 @@ This module contains articles about reactive Spring 5 - [Testing Reactive Streams Using StepVerifier and TestPublisher](https://www.baeldung.com/reactive-streams-step-verifier-test-publisher) - [Debugging Reactive Streams in Spring 5](https://www.baeldung.com/spring-debugging-reactive-streams) - [Static Content in Spring WebFlux](https://www.baeldung.com/spring-webflux-static-content) -- [Spring WebClient Filters](https://www.baeldung.com/spring-webclient-filters) +- [Server-Sent Events in Spring](https://www.baeldung.com/spring-server-sent-events) - More articles: [[<-- prev]](/spring-5-reactive) diff --git a/spring-5-reactive-2/pom.xml b/spring-5-reactive-2/pom.xml index fdeebd1dfd..4cb85d879e 100644 --- a/spring-5-reactive-2/pom.xml +++ b/spring-5-reactive-2/pom.xml @@ -53,6 +53,11 @@ reactor-test test + + org.springframework.security + spring-security-test + test + diff --git a/spring-5-reactive/src/main/java/com/baeldung/reactive/serversentevents/consumer/ConsumerSSEApplication.java b/spring-5-reactive-2/src/main/java/com/baeldung/reactive/serversentevents/consumer/ConsumerSSEApplication.java similarity index 100% rename from spring-5-reactive/src/main/java/com/baeldung/reactive/serversentevents/consumer/ConsumerSSEApplication.java rename to spring-5-reactive-2/src/main/java/com/baeldung/reactive/serversentevents/consumer/ConsumerSSEApplication.java diff --git a/spring-5-reactive/src/main/java/com/baeldung/reactive/serversentevents/consumer/controller/ClientController.java b/spring-5-reactive-2/src/main/java/com/baeldung/reactive/serversentevents/consumer/controller/ClientController.java similarity index 100% rename from spring-5-reactive/src/main/java/com/baeldung/reactive/serversentevents/consumer/controller/ClientController.java rename to spring-5-reactive-2/src/main/java/com/baeldung/reactive/serversentevents/consumer/controller/ClientController.java diff --git a/spring-5-reactive/src/main/java/com/baeldung/reactive/serversentevents/server/ServerSSEApplication.java b/spring-5-reactive-2/src/main/java/com/baeldung/reactive/serversentevents/server/ServerSSEApplication.java similarity index 100% rename from spring-5-reactive/src/main/java/com/baeldung/reactive/serversentevents/server/ServerSSEApplication.java rename to spring-5-reactive-2/src/main/java/com/baeldung/reactive/serversentevents/server/ServerSSEApplication.java diff --git a/spring-5-reactive/src/main/java/com/baeldung/reactive/serversentevents/server/controllers/ServerController.java b/spring-5-reactive-2/src/main/java/com/baeldung/reactive/serversentevents/server/controllers/ServerController.java similarity index 100% rename from spring-5-reactive/src/main/java/com/baeldung/reactive/serversentevents/server/controllers/ServerController.java rename to spring-5-reactive-2/src/main/java/com/baeldung/reactive/serversentevents/server/controllers/ServerController.java diff --git a/spring-5-reactive/src/test/java/com/baeldung/reactive/serversentsevents/ServiceSentEventLiveTest.java b/spring-5-reactive-2/src/test/java/com/baeldung/reactive/serversentsevents/ServiceSentEventLiveTest.java similarity index 92% rename from spring-5-reactive/src/test/java/com/baeldung/reactive/serversentsevents/ServiceSentEventLiveTest.java rename to spring-5-reactive-2/src/test/java/com/baeldung/reactive/serversentsevents/ServiceSentEventLiveTest.java index 547cd99034..946a038763 100644 --- a/spring-5-reactive/src/test/java/com/baeldung/reactive/serversentsevents/ServiceSentEventLiveTest.java +++ b/spring-5-reactive-2/src/test/java/com/baeldung/reactive/serversentsevents/ServiceSentEventLiveTest.java @@ -8,7 +8,9 @@ import org.springframework.http.MediaType; import org.springframework.security.test.context.support.WithMockUser; import org.springframework.test.web.reactive.server.WebTestClient; -@SpringBootTest +import com.baeldung.reactive.serversentevents.server.ServerSSEApplication; + +@SpringBootTest(classes = ServerSSEApplication.class) @WithMockUser public class ServiceSentEventLiveTest { diff --git a/spring-5-reactive-client/README.md b/spring-5-reactive-client/README.md index bb308ae330..eebdc23aed 100644 --- a/spring-5-reactive-client/README.md +++ b/spring-5-reactive-client/README.md @@ -10,3 +10,4 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring - [Simultaneous Spring WebClient Calls](https://www.baeldung.com/spring-webclient-simultaneous-calls) - [Logging Spring WebClient Calls](https://www.baeldung.com/spring-log-webclient-calls) - [Mocking a WebClient in Spring](https://www.baeldung.com/spring-mocking-webclient) +- [Spring WebClient Filters](https://www.baeldung.com/spring-webclient-filters) diff --git a/spring-5-reactive-client/pom.xml b/spring-5-reactive-client/pom.xml index 0b5efd1a47..7ae7ba6edd 100644 --- a/spring-5-reactive-client/pom.xml +++ b/spring-5-reactive-client/pom.xml @@ -33,6 +33,10 @@ org.springframework.boot spring-boot-starter-webflux + + org.springframework.boot + spring-boot-starter-security + org.projectreactor reactor-spring diff --git a/spring-5-reactive-2/src/main/java/com/baeldung/webclient/filter/WebClientFilters.java b/spring-5-reactive-client/src/main/java/com/baeldung/webclient/filter/WebClientFilters.java similarity index 100% rename from spring-5-reactive-2/src/main/java/com/baeldung/webclient/filter/WebClientFilters.java rename to spring-5-reactive-client/src/main/java/com/baeldung/webclient/filter/WebClientFilters.java diff --git a/spring-5-reactive-2/src/test/java/com/baeldung/webclient/filter/FilteredWebClientUnitTest.java b/spring-5-reactive-client/src/test/java/com/baeldung/webclient/filter/FilteredWebClientUnitTest.java similarity index 100% rename from spring-5-reactive-2/src/test/java/com/baeldung/webclient/filter/FilteredWebClientUnitTest.java rename to spring-5-reactive-client/src/test/java/com/baeldung/webclient/filter/FilteredWebClientUnitTest.java diff --git a/spring-5-reactive-security/README.md b/spring-5-reactive-security/README.md index a0f47a503d..915f74cd78 100644 --- a/spring-5-reactive-security/README.md +++ b/spring-5-reactive-security/README.md @@ -12,3 +12,4 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring - [Guide to Spring 5 WebFlux](https://www.baeldung.com/spring-webflux) - [Introduction to the Functional Web Framework in Spring 5](https://www.baeldung.com/spring-5-functional-web) - [Guide to the AuthenticationManagerResolver in Spring Security](https://www.baeldung.com/spring-security-authenticationmanagerresolver) +- [Spring Webflux and CORS](https://www.baeldung.com/spring-webflux-cors) diff --git a/spring-5-reactive/src/main/java/com/baeldung/reactive/cors/annotated/CorsOnAnnotatedElementsApplication.java b/spring-5-reactive-security/src/main/java/com/baeldung/reactive/cors/annotated/CorsOnAnnotatedElementsApplication.java similarity index 100% rename from spring-5-reactive/src/main/java/com/baeldung/reactive/cors/annotated/CorsOnAnnotatedElementsApplication.java rename to spring-5-reactive-security/src/main/java/com/baeldung/reactive/cors/annotated/CorsOnAnnotatedElementsApplication.java diff --git a/spring-5-reactive/src/main/java/com/baeldung/reactive/cors/annotated/controllers/CorsOnClassController.java b/spring-5-reactive-security/src/main/java/com/baeldung/reactive/cors/annotated/controllers/CorsOnClassController.java similarity index 100% rename from spring-5-reactive/src/main/java/com/baeldung/reactive/cors/annotated/controllers/CorsOnClassController.java rename to spring-5-reactive-security/src/main/java/com/baeldung/reactive/cors/annotated/controllers/CorsOnClassController.java diff --git a/spring-5-reactive/src/main/java/com/baeldung/reactive/cors/annotated/controllers/CorsOnMethodsController.java b/spring-5-reactive-security/src/main/java/com/baeldung/reactive/cors/annotated/controllers/CorsOnMethodsController.java similarity index 100% rename from spring-5-reactive/src/main/java/com/baeldung/reactive/cors/annotated/controllers/CorsOnMethodsController.java rename to spring-5-reactive-security/src/main/java/com/baeldung/reactive/cors/annotated/controllers/CorsOnMethodsController.java diff --git a/spring-5-reactive/src/main/java/com/baeldung/reactive/cors/global/CorsGlobalConfigApplication.java b/spring-5-reactive-security/src/main/java/com/baeldung/reactive/cors/global/CorsGlobalConfigApplication.java similarity index 100% rename from spring-5-reactive/src/main/java/com/baeldung/reactive/cors/global/CorsGlobalConfigApplication.java rename to spring-5-reactive-security/src/main/java/com/baeldung/reactive/cors/global/CorsGlobalConfigApplication.java diff --git a/spring-5-reactive/src/main/java/com/baeldung/reactive/cors/global/config/CorsGlobalConfiguration.java b/spring-5-reactive-security/src/main/java/com/baeldung/reactive/cors/global/config/CorsGlobalConfiguration.java similarity index 100% rename from spring-5-reactive/src/main/java/com/baeldung/reactive/cors/global/config/CorsGlobalConfiguration.java rename to spring-5-reactive-security/src/main/java/com/baeldung/reactive/cors/global/config/CorsGlobalConfiguration.java diff --git a/spring-5-reactive/src/main/java/com/baeldung/reactive/cors/global/controllers/FurtherCorsConfigsController.java b/spring-5-reactive-security/src/main/java/com/baeldung/reactive/cors/global/controllers/FurtherCorsConfigsController.java similarity index 100% rename from spring-5-reactive/src/main/java/com/baeldung/reactive/cors/global/controllers/FurtherCorsConfigsController.java rename to spring-5-reactive-security/src/main/java/com/baeldung/reactive/cors/global/controllers/FurtherCorsConfigsController.java diff --git a/spring-5-reactive/src/main/java/com/baeldung/reactive/cors/global/controllers/RegularRestController.java b/spring-5-reactive-security/src/main/java/com/baeldung/reactive/cors/global/controllers/RegularRestController.java similarity index 100% rename from spring-5-reactive/src/main/java/com/baeldung/reactive/cors/global/controllers/RegularRestController.java rename to spring-5-reactive-security/src/main/java/com/baeldung/reactive/cors/global/controllers/RegularRestController.java diff --git a/spring-5-reactive/src/main/java/com/baeldung/reactive/cors/global/functional/handlers/CorsGlobalFunctionalHandler.java b/spring-5-reactive-security/src/main/java/com/baeldung/reactive/cors/global/functional/handlers/CorsGlobalFunctionalHandler.java similarity index 100% rename from spring-5-reactive/src/main/java/com/baeldung/reactive/cors/global/functional/handlers/CorsGlobalFunctionalHandler.java rename to spring-5-reactive-security/src/main/java/com/baeldung/reactive/cors/global/functional/handlers/CorsGlobalFunctionalHandler.java diff --git a/spring-5-reactive/src/main/java/com/baeldung/reactive/cors/global/functional/routers/CorsRouterFunctions.java b/spring-5-reactive-security/src/main/java/com/baeldung/reactive/cors/global/functional/routers/CorsRouterFunctions.java similarity index 100% rename from spring-5-reactive/src/main/java/com/baeldung/reactive/cors/global/functional/routers/CorsRouterFunctions.java rename to spring-5-reactive-security/src/main/java/com/baeldung/reactive/cors/global/functional/routers/CorsRouterFunctions.java diff --git a/spring-5-reactive/src/main/java/com/baeldung/reactive/cors/webfilter/CorsWebFilterApplication.java b/spring-5-reactive-security/src/main/java/com/baeldung/reactive/cors/webfilter/CorsWebFilterApplication.java similarity index 100% rename from spring-5-reactive/src/main/java/com/baeldung/reactive/cors/webfilter/CorsWebFilterApplication.java rename to spring-5-reactive-security/src/main/java/com/baeldung/reactive/cors/webfilter/CorsWebFilterApplication.java diff --git a/spring-5-reactive/src/main/java/com/baeldung/reactive/cors/webfilter/config/CorsWebFilterConfig.java b/spring-5-reactive-security/src/main/java/com/baeldung/reactive/cors/webfilter/config/CorsWebFilterConfig.java similarity index 100% rename from spring-5-reactive/src/main/java/com/baeldung/reactive/cors/webfilter/config/CorsWebFilterConfig.java rename to spring-5-reactive-security/src/main/java/com/baeldung/reactive/cors/webfilter/config/CorsWebFilterConfig.java diff --git a/spring-5-reactive/src/main/java/com/baeldung/reactive/cors/webfilter/controllers/FurtherCorsConfigsController.java b/spring-5-reactive-security/src/main/java/com/baeldung/reactive/cors/webfilter/controllers/FurtherCorsConfigsController.java similarity index 100% rename from spring-5-reactive/src/main/java/com/baeldung/reactive/cors/webfilter/controllers/FurtherCorsConfigsController.java rename to spring-5-reactive-security/src/main/java/com/baeldung/reactive/cors/webfilter/controllers/FurtherCorsConfigsController.java diff --git a/spring-5-reactive/src/main/java/com/baeldung/reactive/cors/webfilter/controllers/RegularRestController.java b/spring-5-reactive-security/src/main/java/com/baeldung/reactive/cors/webfilter/controllers/RegularRestController.java similarity index 100% rename from spring-5-reactive/src/main/java/com/baeldung/reactive/cors/webfilter/controllers/RegularRestController.java rename to spring-5-reactive-security/src/main/java/com/baeldung/reactive/cors/webfilter/controllers/RegularRestController.java diff --git a/spring-5-reactive/src/main/java/com/baeldung/reactive/cors/webfilter/functional/handlers/CorsWithWebFilterHandler.java b/spring-5-reactive-security/src/main/java/com/baeldung/reactive/cors/webfilter/functional/handlers/CorsWithWebFilterHandler.java similarity index 100% rename from spring-5-reactive/src/main/java/com/baeldung/reactive/cors/webfilter/functional/handlers/CorsWithWebFilterHandler.java rename to spring-5-reactive-security/src/main/java/com/baeldung/reactive/cors/webfilter/functional/handlers/CorsWithWebFilterHandler.java diff --git a/spring-5-reactive/src/main/java/com/baeldung/reactive/cors/webfilter/functional/routers/CorsWithWebFilterRouterFunctions.java b/spring-5-reactive-security/src/main/java/com/baeldung/reactive/cors/webfilter/functional/routers/CorsWithWebFilterRouterFunctions.java similarity index 100% rename from spring-5-reactive/src/main/java/com/baeldung/reactive/cors/webfilter/functional/routers/CorsWithWebFilterRouterFunctions.java rename to spring-5-reactive-security/src/main/java/com/baeldung/reactive/cors/webfilter/functional/routers/CorsWithWebFilterRouterFunctions.java diff --git a/spring-5-reactive/src/test/java/com/baeldung/reactive/cors/CorsOnAnnotatedElementsLiveTest.java b/spring-5-reactive-security/src/test/java/com/baeldung/reactive/cors/CorsOnAnnotatedElementsLiveTest.java similarity index 96% rename from spring-5-reactive/src/test/java/com/baeldung/reactive/cors/CorsOnAnnotatedElementsLiveTest.java rename to spring-5-reactive-security/src/test/java/com/baeldung/reactive/cors/CorsOnAnnotatedElementsLiveTest.java index e6847e63da..5fd20eedfd 100644 --- a/spring-5-reactive/src/test/java/com/baeldung/reactive/cors/CorsOnAnnotatedElementsLiveTest.java +++ b/spring-5-reactive-security/src/test/java/com/baeldung/reactive/cors/CorsOnAnnotatedElementsLiveTest.java @@ -6,7 +6,9 @@ import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.web.reactive.server.WebTestClient; import org.springframework.test.web.reactive.server.WebTestClient.ResponseSpec; -@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) +import com.baeldung.reactive.cors.annotated.CorsOnAnnotatedElementsApplication; + +@SpringBootTest(classes = CorsOnAnnotatedElementsApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) public class CorsOnAnnotatedElementsLiveTest { private static final String BASE_URL = "http://localhost:8081"; diff --git a/spring-5-reactive/src/test/java/com/baeldung/reactive/cors/CorsOnGlobalConfigLiveTest.java b/spring-5-reactive-security/src/test/java/com/baeldung/reactive/cors/CorsOnGlobalConfigLiveTest.java similarity index 94% rename from spring-5-reactive/src/test/java/com/baeldung/reactive/cors/CorsOnGlobalConfigLiveTest.java rename to spring-5-reactive-security/src/test/java/com/baeldung/reactive/cors/CorsOnGlobalConfigLiveTest.java index 008f1a16f2..5c6582c127 100644 --- a/spring-5-reactive/src/test/java/com/baeldung/reactive/cors/CorsOnGlobalConfigLiveTest.java +++ b/spring-5-reactive-security/src/test/java/com/baeldung/reactive/cors/CorsOnGlobalConfigLiveTest.java @@ -6,7 +6,9 @@ import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.web.reactive.server.WebTestClient; import org.springframework.test.web.reactive.server.WebTestClient.ResponseSpec; -@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) +import com.baeldung.reactive.cors.global.CorsGlobalConfigApplication; + +@SpringBootTest(classes = CorsGlobalConfigApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) public class CorsOnGlobalConfigLiveTest { private static final String BASE_URL = "http://localhost:8082"; diff --git a/spring-5-reactive/src/test/java/com/baeldung/reactive/cors/CorsOnWebFilterLiveTest.java b/spring-5-reactive-security/src/test/java/com/baeldung/reactive/cors/CorsOnWebFilterLiveTest.java similarity index 94% rename from spring-5-reactive/src/test/java/com/baeldung/reactive/cors/CorsOnWebFilterLiveTest.java rename to spring-5-reactive-security/src/test/java/com/baeldung/reactive/cors/CorsOnWebFilterLiveTest.java index f8a4f34e29..7cc44454ec 100644 --- a/spring-5-reactive/src/test/java/com/baeldung/reactive/cors/CorsOnWebFilterLiveTest.java +++ b/spring-5-reactive-security/src/test/java/com/baeldung/reactive/cors/CorsOnWebFilterLiveTest.java @@ -6,7 +6,9 @@ import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.web.reactive.server.WebTestClient; import org.springframework.test.web.reactive.server.WebTestClient.ResponseSpec; -@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) +import com.baeldung.reactive.cors.webfilter.CorsWebFilterApplication; + +@SpringBootTest(classes = CorsWebFilterApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) public class CorsOnWebFilterLiveTest { private static final String BASE_URL = "http://localhost:8083"; diff --git a/spring-5-reactive/README.md b/spring-5-reactive/README.md index 41d831632a..1945b7ea33 100644 --- a/spring-5-reactive/README.md +++ b/spring-5-reactive/README.md @@ -7,14 +7,11 @@ The "REST With Spring" Classes: https://bit.ly/restwithspring ### Relevant Articles -- [Introduction to the Functional Web Framework in Spring 5](https://www.baeldung.com/spring-5-functional-web) - [Spring 5 WebClient](https://www.baeldung.com/spring-5-webclient) - [Exploring the Spring 5 WebFlux URL Matching](https://www.baeldung.com/spring-5-mvc-url-matching) - [Reactive WebSockets with Spring 5](https://www.baeldung.com/spring-5-reactive-websockets) - [Spring Webflux Filters](https://www.baeldung.com/spring-webflux-filters) - [How to Set a Header on a Response with Spring 5](https://www.baeldung.com/spring-response-header) -- [Spring Webflux and CORS](https://www.baeldung.com/spring-webflux-cors) - [Handling Errors in Spring WebFlux](https://www.baeldung.com/spring-webflux-errors) -- [Server-Sent Events in Spring](https://www.baeldung.com/spring-server-sent-events) - [A Guide to Spring Session Reactive Support: WebSession](https://www.baeldung.com/spring-session-reactive) - More articles: [[next -->]](/spring-5-reactive-2)