Drop Spring Data tests.

This commit is contained in:
Jon Chambers 2020-07-02 11:38:07 -04:00 committed by Jon Chambers
parent a8f9f7f1e9
commit 2f501f8a35
2 changed files with 0 additions and 56 deletions

View File

@ -69,13 +69,6 @@
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-redis</artifactId>
<version>1.8.0.RELEASE</version>
<scope>test</scope>
</dependency>
</dependencies>
<prerequisites>

View File

@ -1,49 +0,0 @@
package redis.embedded;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.springframework.data.redis.connection.jedis.JedisConnectionFactory;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.StringRedisTemplate;
import redis.clients.jedis.JedisShardInfo;
import static org.junit.Assert.assertEquals;
public class SpringDataConnectivityTest {
private RedisServer redisServer;
private RedisTemplate<String, String> template;
private JedisConnectionFactory connectionFactory;
@Before
public void setUp() throws Exception {
redisServer = new RedisServer(6379);
redisServer.start();
JedisShardInfo shardInfo = new JedisShardInfo("localhost", 6379);
connectionFactory = new JedisConnectionFactory();
connectionFactory.setShardInfo(shardInfo);
template = new StringRedisTemplate();
template.setConnectionFactory(connectionFactory);
template.afterPropertiesSet();
}
@Test
public void shouldBeAbleToUseSpringData() throws Exception {
// given
template.opsForValue().set("foo", "bar");
// when
String result = template.opsForValue().get("foo");
// then
assertEquals("bar", result);
}
@After
public void tearDown() throws Exception {
redisServer.stop();
}
}