Skip to content

Commit

Permalink
DATAREDIS-1196 - Adapt to Lettuce 6.0-RC2 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
christophstrobl committed Sep 16, 2020
1 parent 97b5acf commit 7cdc0f5
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public List<Long> lPos(byte[] key, byte[] element, @Nullable Integer rank, @Null

LPosArgs args = new LPosArgs();
if (rank != null) {
args.first(rank);
args.rank(rank);
}
try {
if (isPipelined()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public Flux<NumericResponse<LPosCommand, Long>> lPos(Publisher<LPosCommand> comm

LPosArgs args = new LPosArgs();
if (command.getRank() != null) {
args.first(command.getRank());
args.rank(command.getRank());
}

Flux<Long> values;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1493,7 +1493,6 @@ public void lPos() {
@Test // DATAREDIS-1196
@IfProfileValue(name = "redisVersion", value = "6.0.6+")
@WithRedisDriver({ RedisDriver.LETTUCE })
@Ignore("https://github.com/lettuce-io/lettuce-core/issues/1410")
public void lPosRank() {

actual.add(connection.rPush("mylist", "a", "b", "c", "1", "2", "3", "c", "c"));
Expand All @@ -1505,7 +1504,6 @@ public void lPosRank() {
@Test // DATAREDIS-1196
@IfProfileValue(name = "redisVersion", value = "6.0.6+")
@WithRedisDriver({ RedisDriver.LETTUCE })
@Ignore("https://github.com/lettuce-io/lettuce-core/issues/1410")
public void lPosNegativeRank() {

actual.add(connection.rPush("mylist", "a", "b", "c", "1", "2", "3", "c", "c"));
Expand All @@ -1528,7 +1526,6 @@ public void lPosCount() {
@Test // DATAREDIS-1196
@IfProfileValue(name = "redisVersion", value = "6.0.6+")
@WithRedisDriver({ RedisDriver.LETTUCE })
@Ignore("https://github.com/lettuce-io/lettuce-core/issues/1410")
public void lPosRankCount() {

actual.add(connection.rPush("mylist", "a", "b", "c", "1", "2", "3", "c", "c"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import java.time.Duration;
import java.util.Arrays;

import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.springframework.dao.InvalidDataAccessApiUsageException;
Expand Down Expand Up @@ -327,7 +326,6 @@ public void lPos() {

@Test // DATAREDIS-1196
@IfProfileValue(name = "redisVersion", value = "6.0.6+")
@Ignore("https://github.com/lettuce-io/lettuce-core/issues/1410")
public void lPosRank() {

nativeCommands.rpush(KEY_1, "a", "b", "c", "1", "2", "3", "c", "c");
Expand All @@ -341,7 +339,6 @@ public void lPosRank() {

@Test // DATAREDIS-1196
@IfProfileValue(name = "redisVersion", value = "6.0.6+")
@Ignore("https://github.com/lettuce-io/lettuce-core/issues/1410")
public void lPosNegativeRank() {

nativeCommands.rpush(KEY_1, "a", "b", "c", "1", "2", "3", "c", "c");
Expand Down Expand Up @@ -369,7 +366,6 @@ public void lPosCount() {

@Test // DATAREDIS-1196
@IfProfileValue(name = "redisVersion", value = "6.0.6+")
@Ignore("https://github.com/lettuce-io/lettuce-core/issues/1410")
public void lPosRankCount() {

nativeCommands.rpush(KEY_1, "a", "b", "c", "1", "2", "3", "c", "c");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
Expand Down Expand Up @@ -337,7 +336,6 @@ public void indexOf() {

@Test // DATAREDIS-1196
@IfProfileValue(name = "redisVersion", value = "6.0.6+")
@Ignore("https://github.com/lettuce-io/lettuce-core/issues/1410")
public void lastIndexOf() {

K key = keyFactory.instance();
Expand All @@ -347,7 +345,8 @@ public void lastIndexOf() {

assertThat(listOps.rightPush(key, v1)).isEqualTo(Long.valueOf(1));
assertThat(listOps.rightPush(key, v2)).isEqualTo(Long.valueOf(2));
assertThat(listOps.rightPush(key, v1, v3)).isEqualTo(Long.valueOf(3));
assertThat(listOps.rightPush(key, v1)).isEqualTo(Long.valueOf(3));
assertThat(listOps.rightPush(key, v3)).isEqualTo(Long.valueOf(4));
assertThat(listOps.lastIndexOf(key, v1)).isEqualTo(2);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

import org.junit.AfterClass;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
Expand Down Expand Up @@ -388,7 +387,6 @@ public void indexOf() {

@Test // DATAREDIS-1196
@IfProfileValue(name = "redisVersion", value = "6.0.6+")
@Ignore("https://github.com/lettuce-io/lettuce-core/issues/1410")
public void lastIndexOf() {

K key = keyFactory.instance();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@

import org.assertj.core.api.Assumptions;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.springframework.data.redis.ObjectFactory;
Expand All @@ -44,7 +43,7 @@
public abstract class AbstractRedisListTests<T> extends AbstractRedisCollectionTests<T> {

@Rule public MinimumRedisVersionRule redisVersion = new MinimumRedisVersionRule();

protected RedisList<T> list;

/**
Expand Down Expand Up @@ -534,7 +533,6 @@ public void testTakeLast() {

@Test // DATAREDIS-1196
@IfProfileValue(name = "redisVersion", value = "6.0.6+")
@Ignore("https://github.com/lettuce-io/lettuce-core/issues/1410")
public void lastIndexOf() {

Assumptions.assumeThat(template.getConnectionFactory()).isInstanceOf(LettuceConnectionFactory.class);
Expand All @@ -545,8 +543,9 @@ public void lastIndexOf() {

list.add(t1);
list.add(t2);
list.add(t1);
list.add(t3);

assertThat(list.indexOf(t1)).isEqualTo(2);
assertThat(list.lastIndexOf(t1)).isEqualTo(2);
}
}

0 comments on commit 7cdc0f5

Please sign in to comment.