diff --git a/pom.xml b/pom.xml index 9a34ed0afe..f2a53f38b7 100644 --- a/pom.xml +++ b/pom.xml @@ -7,9 +7,6 @@ com.baeldung parent-modules 1.0.0-SNAPSHOT - - spring-webflux-caching - parent-modules pom diff --git a/spring-5-webflux/pom.xml b/spring-5-webflux/pom.xml index 69de83c227..cd3564d404 100644 --- a/spring-5-webflux/pom.xml +++ b/spring-5-webflux/pom.xml @@ -66,11 +66,31 @@ + + io.projectreactor.addons + reactor-extra + 3.4.5 + + + com.github.ben-manes.caffeine + caffeine + 3.0.4 + + + org.springframework.boot + spring-boot-starter-data-mongodb-reactive + io.projectreactor reactor-test test + + org.testcontainers + mongodb + 1.16.2 + test + com.squareup.okhttp3 mockwebserver diff --git a/spring-webflux-caching/src/main/java/com/baeldung/caching/Item.java b/spring-5-webflux/src/main/java/com/baeldung/spring/caching/Item.java similarity index 96% rename from spring-webflux-caching/src/main/java/com/baeldung/caching/Item.java rename to spring-5-webflux/src/main/java/com/baeldung/spring/caching/Item.java index 127975b0e7..7b79ff7503 100644 --- a/spring-webflux-caching/src/main/java/com/baeldung/caching/Item.java +++ b/spring-5-webflux/src/main/java/com/baeldung/spring/caching/Item.java @@ -1,4 +1,4 @@ -package com.baeldung.caching; +package com.baeldung.spring.caching; import org.springframework.data.annotation.Id; import org.springframework.data.mongodb.core.mapping.Document; diff --git a/spring-webflux-caching/src/main/java/com/baeldung/caching/ItemRepository.java b/spring-5-webflux/src/main/java/com/baeldung/spring/caching/ItemRepository.java similarity index 85% rename from spring-webflux-caching/src/main/java/com/baeldung/caching/ItemRepository.java rename to spring-5-webflux/src/main/java/com/baeldung/spring/caching/ItemRepository.java index a76489623e..27c97de36a 100644 --- a/spring-webflux-caching/src/main/java/com/baeldung/caching/ItemRepository.java +++ b/spring-5-webflux/src/main/java/com/baeldung/spring/caching/ItemRepository.java @@ -1,4 +1,4 @@ -package com.baeldung.caching; +package com.baeldung.spring.caching; import org.springframework.data.mongodb.repository.ReactiveMongoRepository; import org.springframework.stereotype.Repository; diff --git a/spring-webflux-caching/src/main/java/com/baeldung/caching/ItemService.java b/spring-5-webflux/src/main/java/com/baeldung/spring/caching/ItemService.java similarity index 96% rename from spring-webflux-caching/src/main/java/com/baeldung/caching/ItemService.java rename to spring-5-webflux/src/main/java/com/baeldung/spring/caching/ItemService.java index 9dc9ba1642..b24b54521e 100644 --- a/spring-webflux-caching/src/main/java/com/baeldung/caching/ItemService.java +++ b/spring-5-webflux/src/main/java/com/baeldung/spring/caching/ItemService.java @@ -1,4 +1,4 @@ -package com.baeldung.caching; +package com.baeldung.spring.caching; import com.github.benmanes.caffeine.cache.Caffeine; import com.github.benmanes.caffeine.cache.LoadingCache; diff --git a/spring-webflux-caching/src/main/java/com/baeldung/caching/SpringWebfluxCachingApplication.java b/spring-5-webflux/src/main/java/com/baeldung/spring/caching/SpringWebfluxCachingApplication.java similarity index 93% rename from spring-webflux-caching/src/main/java/com/baeldung/caching/SpringWebfluxCachingApplication.java rename to spring-5-webflux/src/main/java/com/baeldung/spring/caching/SpringWebfluxCachingApplication.java index 7331576bd5..5266e33775 100644 --- a/spring-webflux-caching/src/main/java/com/baeldung/caching/SpringWebfluxCachingApplication.java +++ b/spring-5-webflux/src/main/java/com/baeldung/spring/caching/SpringWebfluxCachingApplication.java @@ -1,4 +1,4 @@ -package com.baeldung.caching; +package com.baeldung.spring.caching; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; diff --git a/spring-webflux-caching/src/main/resources/application.properties b/spring-5-webflux/src/main/resources/application-cache.properties similarity index 100% rename from spring-webflux-caching/src/main/resources/application.properties rename to spring-5-webflux/src/main/resources/application-cache.properties diff --git a/spring-webflux-caching/src/test/java/com/baeldung/caching/MonoFluxResultCachingLiveTest.java b/spring-5-webflux/src/test/java/com/baeldung/spring/caching/MonoFluxResultCachingLiveTest.java similarity index 96% rename from spring-webflux-caching/src/test/java/com/baeldung/caching/MonoFluxResultCachingLiveTest.java rename to spring-5-webflux/src/test/java/com/baeldung/spring/caching/MonoFluxResultCachingLiveTest.java index bf96b35dcb..322b3c5aa5 100644 --- a/spring-webflux-caching/src/test/java/com/baeldung/caching/MonoFluxResultCachingLiveTest.java +++ b/spring-5-webflux/src/test/java/com/baeldung/spring/caching/MonoFluxResultCachingLiveTest.java @@ -1,11 +1,10 @@ -package com.baeldung.caching; +package com.baeldung.spring.caching; -import org.assertj.core.api.Assertions; -import org.junit.ClassRule; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.DynamicPropertyRegistry; import org.springframework.test.context.DynamicPropertySource; import org.testcontainers.containers.MongoDBContainer; @@ -15,6 +14,7 @@ import reactor.core.publisher.Mono; import static org.assertj.core.api.Assertions.assertThat; @SpringBootTest +@ActiveProfiles("cache") public class MonoFluxResultCachingLiveTest { diff --git a/spring-webflux-caching/pom.xml b/spring-webflux-caching/pom.xml deleted file mode 100644 index ed9800bce9..0000000000 --- a/spring-webflux-caching/pom.xml +++ /dev/null @@ -1,67 +0,0 @@ - - - 4.0.0 - com.baeldung.spring - spring-webflux-caching - 1.0.0-SNAPSHOT - spring-webflux-caching - jar - Spring WebFlux Caching Sample - - - com.baeldung - parent-boot-2 - 0.0.1-SNAPSHOT - ../parent-boot-2 - - - - - - org.springframework.boot - spring-boot-starter-webflux - - - io.reactivex.rxjava2 - rxjava - 2.2.19 - - - io.projectreactor.addons - reactor-extra - 3.4.5 - - - com.github.ben-manes.caffeine - caffeine - 3.0.4 - - - org.springframework.boot - spring-boot-starter-data-mongodb-reactive - - - com.fasterxml.jackson.core - jackson-databind - - - org.springframework.boot - spring-boot-starter-test - test - - - io.projectreactor - reactor-test - test - - - org.testcontainers - mongodb - 1.16.2 - test - - - - \ No newline at end of file