From ff0db905bc6d1ef034740d1b890a868719f9d48b Mon Sep 17 00:00:00 2001 From: saikat Date: Thu, 29 Feb 2024 11:29:42 +0530 Subject: [PATCH] reverted dependencies to check --- spring-boot-modules/spring-caching-2/pom.xml | 8 +++---- ...CustomerServiceCachingIntegrationTest.java | 7 +++--- .../ItemServiceCachingIntegrationTest.java | 23 ++++++++----------- 3 files changed, 16 insertions(+), 22 deletions(-) diff --git a/spring-boot-modules/spring-caching-2/pom.xml b/spring-boot-modules/spring-caching-2/pom.xml index 3934a8b22e..7a4744802a 100644 --- a/spring-boot-modules/spring-caching-2/pom.xml +++ b/spring-boot-modules/spring-caching-2/pom.xml @@ -1,7 +1,7 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 spring-caching-2 0.1-SNAPSHOT @@ -51,7 +51,7 @@ ${caffeine.version} - com.github.codemonstur + it.ozimov embedded-redis ${embedded.redis.version} @@ -65,7 +65,7 @@ - 1.4.0 + 0.7.3 3.1.8 diff --git a/spring-boot-modules/spring-caching-2/src/test/java/com/baeldung/caching/multicache/CustomerServiceCachingIntegrationTest.java b/spring-boot-modules/spring-caching-2/src/test/java/com/baeldung/caching/multicache/CustomerServiceCachingIntegrationTest.java index 919c32fc66..17faef871c 100644 --- a/spring-boot-modules/spring-caching-2/src/test/java/com/baeldung/caching/multicache/CustomerServiceCachingIntegrationTest.java +++ b/spring-boot-modules/spring-caching-2/src/test/java/com/baeldung/caching/multicache/CustomerServiceCachingIntegrationTest.java @@ -17,7 +17,6 @@ import redis.embedded.RedisServer; import javax.annotation.PostConstruct; import javax.annotation.PreDestroy; -import java.io.IOException; import java.util.concurrent.TimeUnit; import static org.assertj.core.api.Assertions.assertThat; @@ -111,17 +110,17 @@ class CustomerServiceCachingIntegrationTest { private final RedisServer redisServer; - public EmbeddedRedisConfiguration() throws IOException { + public EmbeddedRedisConfiguration() { this.redisServer = new RedisServer(); } @PostConstruct - public void startRedis() throws IOException { + public void startRedis() { redisServer.start(); } @PreDestroy - public void stopRedis() throws IOException { + public void stopRedis() { this.redisServer.stop(); } } diff --git a/spring-boot-modules/spring-caching-2/src/test/java/com/baeldung/caching/redis/ItemServiceCachingIntegrationTest.java b/spring-boot-modules/spring-caching-2/src/test/java/com/baeldung/caching/redis/ItemServiceCachingIntegrationTest.java index 7865add769..291e729fb9 100644 --- a/spring-boot-modules/spring-caching-2/src/test/java/com/baeldung/caching/redis/ItemServiceCachingIntegrationTest.java +++ b/spring-boot-modules/spring-caching-2/src/test/java/com/baeldung/caching/redis/ItemServiceCachingIntegrationTest.java @@ -1,14 +1,5 @@ package com.baeldung.caching.redis; -import static org.assertj.core.api.Assertions.assertThat; -import static org.mockito.BDDMockito.given; -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; - -import java.io.IOException; -import java.util.Optional; - -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.springframework.beans.factory.annotation.Autowired; @@ -21,17 +12,21 @@ import org.springframework.cache.CacheManager; import org.springframework.cache.annotation.EnableCaching; import org.springframework.context.annotation.Import; import org.springframework.test.context.junit.jupiter.SpringExtension; - import redis.embedded.RedisServer; import javax.annotation.PostConstruct; import javax.annotation.PreDestroy; +import java.util.Optional; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.mockito.BDDMockito.given; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; @Import({ CacheConfig.class, ItemService.class }) @ExtendWith(SpringExtension.class) @ImportAutoConfiguration(classes = { CacheAutoConfiguration.class, RedisAutoConfiguration.class }) @EnableCaching -@Disabled("This will be fixed.") class ItemServiceCachingIntegrationTest { private static final String AN_ID = "id-1"; @@ -71,17 +66,17 @@ class ItemServiceCachingIntegrationTest { private final RedisServer redisServer; - public EmbeddedRedisConfiguration() throws IOException { + public EmbeddedRedisConfiguration() { this.redisServer = new RedisServer(); } @PostConstruct - public void startRedis() throws IOException { + public void startRedis() { redisServer.start(); } @PreDestroy - public void stopRedis() throws IOException { + public void stopRedis() { this.redisServer.stop(); } }