Redis jEmbedded is a Java library that embeds Redis into your tests, enabling you to run Redis in a lightweight, standalone environment without the need for external dependencies. This simplifies the testing process and ensures consistent results across different environments.
To include Redis jEmbedded in your project, add the following dependency to your pom.xml
if you are using Maven.
Note that if you want to use redis binary version 6, you can add redis-jembedded-v6
:
<dependency>
<groupId>io.josslab</groupId>
<artifactId>redis-jembedded-v7</artifactId>
<version>${redis binary version}</version>
</dependency>
Or add the following to your build.gradle
if you are using Gradle:
implementation 'io.josslab:redis-jembedded-v7:$REDIS_BINARY_VERSION'
Here is an example of how to use Redis jEmbedded in your tests:
import io.josslab.redis.jembedded.RedisServer;
public class ExampleTest {
@Test
public void testRedis() {
RedisServer redisServer = RedisServer.newRedisServer().build();
redisServer.start();
// Your test code that interacts with Redis
redisServer.stop();
}
}
We welcome contributions! If you are interested in contributing to Redis jEmbedded, please follow these guidelines:
- Fork the repository.
- Create a new branch with a descriptive name.
- Make your changes and commit them with clear and concise messages.
- Open a pull request and provide a detailed description of your changes.
Redis jEmbedded is distributed under the MIT License. See the LICENSE file for more information.
If you have any questions or feedback, please feel free to reach out:
- Email: [email protected]
- GitHub: tran4774
- Org: jOOS Lab