Add Slice test annotation for Redis

This commit adds new annotation `@DataRedisTest` which provides test
infrastructure for redis.

See gh-9224
This commit is contained in:
Jayaram Pradhan
2017-05-14 07:51:20 +05:30
committed by Stephane Nicoll
parent 3a63241628
commit 2d36d2a7e4
12 changed files with 539 additions and 1 deletions

View File

@@ -6010,6 +6010,30 @@ disable transaction management for a test or for the whole class as follows:
A list of the auto-configuration that is enabled by `@DataNeo4jTest` can be
<<appendix-test-auto-configuration#test-auto-configuration,found in the appendix>>.
[[boot-features-testing-spring-boot-applications-testing-autoconfigured-redis-test]]
==== Auto-configured Data Redis tests
`@DataRedisTest` can be used if you want to test Redis applications.
[source,java,indent=0]
----
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.data.redis.DataRedisTest;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@DataRedisTest
public class ExampleDataRedisTests {
@Autowired
private YourRepository repository;
//
}
----
A list of the auto-configuration that is enabled by `@DataRedisTest` can be
<<appendix-test-auto-configuration#test-auto-configuration,found in the appendix>>.
[[boot-features-testing-spring-boot-applications-testing-autoconfigured-ldap-test]]