diff --git a/persistence-modules/redis/README.md b/persistence-modules/redis/README.md
index 71d009241a..75c1c18de4 100644
--- a/persistence-modules/redis/README.md
+++ b/persistence-modules/redis/README.md
@@ -4,3 +4,4 @@
- [Introduction to Lettuce – the Java Redis Client](https://www.baeldung.com/java-redis-lettuce)
- [List All Available Redis Keys](https://www.baeldung.com/redis-list-available-keys)
- [Spring Data Redis’s Property-Based Configuration](https://www.baeldung.com/spring-data-redis-properties)
+- [Delete Everything in Redis](https://www.baeldung.com/redis-delete-data)
diff --git a/persistence-modules/redis/pom.xml b/persistence-modules/redis/pom.xml
index c9206e5f92..dab7fc5654 100644
--- a/persistence-modules/redis/pom.xml
+++ b/persistence-modules/redis/pom.xml
@@ -33,7 +33,8 @@
redis.clients
jedis
-
+ 3.3.0
+
com.github.kstyrc
embedded-redis
diff --git a/persistence-modules/redis/src/test/java/com/baeldung/redis/deleteeverything/DeleteEverythingInRedisIntegrationTest.java b/persistence-modules/redis/src/test/java/com/baeldung/redis/deleteeverything/DeleteEverythingInRedisIntegrationTest.java
new file mode 100644
index 0000000000..e0376fc6a5
--- /dev/null
+++ b/persistence-modules/redis/src/test/java/com/baeldung/redis/deleteeverything/DeleteEverythingInRedisIntegrationTest.java
@@ -0,0 +1,91 @@
+package com.baeldung.redis.deleteeverything;
+
+import org.junit.*;
+import redis.clients.jedis.Jedis;
+import redis.embedded.RedisServer;
+
+import java.io.IOException;
+import java.net.ServerSocket;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+
+public class DeleteEverythingInRedisIntegrationTest {
+ private Jedis jedis;
+ private RedisServer redisServer;
+ private int port;
+
+ @Before
+ public void setUp() throws IOException {
+
+ // Take an available port
+ ServerSocket s = new ServerSocket(0);
+ port = s.getLocalPort();
+ s.close();
+
+ redisServer = new RedisServer(port);
+ redisServer.start();
+
+ // Configure JEDIS
+ jedis = new Jedis("localhost", port);
+ }
+
+ @After
+ public void destroy() {
+ redisServer.stop();
+ }
+
+ @Test
+ public void whenPutDataIntoRedis_thenCanBeFound() {
+ String key = "key";
+ String value = "value";
+
+ jedis.set(key, value);
+ String received = jedis.get(key);
+
+ assertEquals(value, received);
+ }
+
+ @Test
+ public void whenPutDataIntoRedisAndThenFlush_thenCannotBeFound() {
+ String key = "key";
+ String value = "value";
+
+ jedis.set(key, value);
+
+ jedis.flushDB();
+
+ String received = jedis.get(key);
+
+ assertNull(received);
+ }
+
+ @Test
+ public void whenPutDataIntoMultipleDatabases_thenFlushAllRemovesAll() {
+ // add keys in different databases
+ jedis.select(0);
+ jedis.set("key1", "value1");
+ jedis.select(1);
+ jedis.set("key2", "value2");
+
+ // we'll find the correct keys in the correct dbs
+ jedis.select(0);
+ assertEquals("value1", jedis.get("key1"));
+ assertNull(jedis.get("key2"));
+
+ jedis.select(1);
+ assertEquals("value2", jedis.get("key2"));
+ assertNull(jedis.get("key1"));
+
+ // then, when we flush
+ jedis.flushAll();
+
+ // the keys will have gone
+ jedis.select(0);
+ assertNull(jedis.get("key1"));
+ assertNull(jedis.get("key2"));
+ jedis.select(1);
+ assertNull(jedis.get("key1"));
+ assertNull(jedis.get("key2"));
+ }
+}
diff --git a/persistence-modules/spring-data-redis/README.md b/persistence-modules/spring-data-redis/README.md
index 175634376b..95cba2c159 100644
--- a/persistence-modules/spring-data-redis/README.md
+++ b/persistence-modules/spring-data-redis/README.md
@@ -4,7 +4,6 @@
- [Introduction to Spring Data Redis](https://www.baeldung.com/spring-data-redis-tutorial)
- [PubSub Messaging with Spring Data Redis](https://www.baeldung.com/spring-data-redis-pub-sub)
- [An Introduction to Spring Data Redis Reactive](https://www.baeldung.com/spring-data-redis-reactive)
-- [Delete Everything in Redis](https://www.baeldung.com/redis-delete-data)
### Build the Project with Tests Running
```
@@ -15,4 +14,3 @@ mvn clean install
```
mvn test
```
-
diff --git a/persistence-modules/spring-data-redis/src/main/java/com/baeldung/spring/data/redis/config/RedisConfig.java b/persistence-modules/spring-data-redis/src/main/java/com/baeldung/spring/data/redis/config/RedisConfig.java
index fdc279be42..497e1506bd 100644
--- a/persistence-modules/spring-data-redis/src/main/java/com/baeldung/spring/data/redis/config/RedisConfig.java
+++ b/persistence-modules/spring-data-redis/src/main/java/com/baeldung/spring/data/redis/config/RedisConfig.java
@@ -35,18 +35,6 @@ public class RedisConfig {
template.setValueSerializer(new GenericToStringSerializer