Java – integration test using redis
With the help of jedis library, I began to use redis.com in my project All work normally, but now I have a problem. My function test needs redis. I want to avoid continuous integration in my system What is the best way to do this?
Solution
Here are some options for functional / integration testing:
>Just start a redis instance on your CI server All tests will be properly cleaned after execution. > Try to control the redis process in some way, that is, some shell scripts or jobs on the CI server start / stop it before / after running the test At least some installation / cleanup burdens will be removed from the test. For each independent build, you will have independent redis settings. > Further control by using some in memory solutions, such as Cassandra (if any) solution you mentioned
One thing to mention is that integration testing should not replace unit testing Unit tests should be preferred. They can cover more situations, while integration tests can only be used to check whether all parts of the application play together And I think that's why many people choose the first choice
This is a similar question about mongodb. The answer has a link to the project, which can be used for the second option (controlling the mongodb process). If you follow some relevant links on the project page, there is another one called NoSQL unit I want to try to override option 3 I didn't use it, but it looks like it also has something redis