Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnsupportedOperationException from ListSubscriber during hrandfieldWithvalues #3122 #3123

Merged
merged 1 commit into from
Jan 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public void set(ByteBuffer bytes) {
public void multi(int count) {

if (!initialized) {
output = OutputFactory.newList(keys == null ? count / 2 : count);
output = OutputFactory.newList(count);
initialized = true;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import javax.inject.Inject;
import java.time.Duration;
import java.time.Instant;
import java.util.Collection;
import java.util.Collections;
import java.util.Date;
import java.util.HashSet;
Expand Down Expand Up @@ -265,6 +266,19 @@ void hrandfield() {
KeyValue.fromNullable("two", "2"), KeyValue.fromNullable("three", "3"));
}

@Test
@EnabledOnCommand("HRANDFIELD")
void hrandfieldIssue3122() {

Map<String, String> hash = new LinkedHashMap<>();
hash.put("one", "1");
hash.put("two", "2");

redis.hset(key, hash);
assertThat(redis.hrandfieldWithvalues(key)).isIn(KeyValue.fromNullable("one", "1"), KeyValue.fromNullable("two", "2"),
KeyValue.fromNullable("three", "3"));
}

@Test
void hset() {
assertThat(redis.hset(key, "one", "1")).isTrue();
Expand Down
Loading