diff --git a/src/main/java/io/lettuce/core/ZAddArgs.java b/src/main/java/io/lettuce/core/ZAddArgs.java index 7d37e38df6..844486f258 100644 --- a/src/main/java/io/lettuce/core/ZAddArgs.java +++ b/src/main/java/io/lettuce/core/ZAddArgs.java @@ -100,6 +100,7 @@ public static ZAddArgs gt() { public static ZAddArgs lt() { return new ZAddArgs().lt(); } + } /** @@ -136,7 +137,8 @@ public ZAddArgs ch() { } /** - * Only update existing elements if the new score is greater than the current score. This flag doesn't prevent adding new elements. + * Only update existing elements if the new score is greater than the current score. This flag doesn't prevent adding new + * elements. * * @return {@code this} {@link ZAddArgs}. * @since 6.1 @@ -149,7 +151,8 @@ public ZAddArgs gt() { } /** - * Only update existing elements if the new score is less than the current score. This flag doesn't prevent adding new elements. + * Only update existing elements if the new score is less than the current score. This flag doesn't prevent adding new + * elements. * * @return {@code this} {@link ZAddArgs}. * @since 6.1 @@ -174,6 +177,7 @@ public void build(CommandArgs args) { if (gt) { args.add("GT"); } + if (lt) { args.add("LT"); } diff --git a/src/test/java/io/lettuce/core/commands/SortedSetCommandIntegrationTests.java b/src/test/java/io/lettuce/core/commands/SortedSetCommandIntegrationTests.java index e0b078a15e..4ff0c893de 100644 --- a/src/test/java/io/lettuce/core/commands/SortedSetCommandIntegrationTests.java +++ b/src/test/java/io/lettuce/core/commands/SortedSetCommandIntegrationTests.java @@ -44,8 +44,11 @@ import io.lettuce.test.condition.EnabledOnCommand; /** + * Integration tests for Sorted Sets via {@link io.lettuce.core.api.sync.RedisSortedSetCommands}. + * * @author Will Glozer * @author Mark Paluch + * @author dengliming */ @ExtendWith(LettuceExtension.class) @TestInstance(TestInstance.Lifecycle.PER_CLASS) @@ -797,6 +800,7 @@ void setup100KeyValues(Set expect) { } @Test + @EnabledOnCommand("ZMSCORE") // Redis 6.2 void zaddgt() { assertThat(redis.zadd(key, 1.0, "a")).isEqualTo(1); // new score less than the current score @@ -813,6 +817,7 @@ void zaddgt() { } @Test + @EnabledOnCommand("ZMSCORE") // Redis 6.2 void zaddlt() { assertThat(redis.zadd(key, 2.0, "a")).isEqualTo(1); // new score greater than the current score