DATAREDIS-513 - Fix RedisServerCommands.time() failure when in pipeline mode.

We fixed a glitch in Jedis/Lettuce RedisConneciton TIME command when used in pipeline or transaction mode.

Original pull request: #199.
This commit is contained in:
Christoph Strobl
2016-05-19 09:00:26 +02:00
committed by Mark Paluch
parent 2b51966768
commit 7af8fdf946
5 changed files with 67 additions and 17 deletions

View File

@@ -17,6 +17,7 @@ package org.springframework.data.redis.connection;
import static org.hamcrest.CoreMatchers.*;
import static org.hamcrest.collection.IsCollectionWithSize.*;
import static org.hamcrest.collection.IsEmptyCollection.*;
import static org.hamcrest.core.Is.is;
import static org.hamcrest.number.IsCloseTo.*;
import static org.junit.Assert.*;
@@ -1919,13 +1920,17 @@ public abstract class AbstractConnectionIntegrationTests {
/**
* @see DATAREDIS-206
* @see DATAREDIS-513
*/
@Test
public void testGetTimeShouldRequestServerTime() {
Long time = connectionFactory.getConnection().time();
assertThat(time, notNullValue());
assertThat(time > 0, equalTo(true));
actual.add(connection.time());
List<Object> results = getResults();
assertThat(results, is(not(empty())));
assertThat(results.get(0), notNullValue());
assertThat((Long) results.get(0) > 0, equalTo(true));
}
/**