reverted dependencies to check

This commit is contained in:
saikat 2024-02-29 11:29:42 +05:30
parent 878509406f
commit ff0db905bc
3 changed files with 16 additions and 22 deletions

View File

@ -51,7 +51,7 @@
<version>${caffeine.version}</version>
</dependency>
<dependency>
<groupId>com.github.codemonstur</groupId>
<groupId>it.ozimov</groupId>
<artifactId>embedded-redis</artifactId>
<version>${embedded.redis.version}</version>
<exclusions>
@ -65,7 +65,7 @@
</dependencies>
<properties>
<embedded.redis.version>1.4.0</embedded.redis.version>
<embedded.redis.version>0.7.3</embedded.redis.version>
<caffeine.version>3.1.8</caffeine.version>
</properties>

View File

@ -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();
}
}

View File

@ -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();
}
}