Skip to content

Commit

Permalink
Add test RedisCommandBuilderUnitTests
Browse files Browse the repository at this point in the history
  • Loading branch information
thachlp committed Sep 13, 2024
1 parent b5de5b5 commit 8ad4121
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/test/java/io/lettuce/core/RedisCommandBuilderUnitTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
import org.junit.jupiter.api.Test;

import java.nio.charset.StandardCharsets;
import java.util.List;
import java.util.Map;

import static org.assertj.core.api.Assertions.assertThat;

Expand Down Expand Up @@ -168,4 +170,14 @@ void shouldCorrectlyConstructClusterMyshardid() {
.isEqualTo("*2\r\n" + "$7\r\n" + "CLUSTER\r\n" + "$9\r\n" + "MYSHARDID\r\n");
}

@Test
void shouldCorrectlyConstructClusterLinks() {

Command<String, String, List<Map<String, Object>>> command = sut.clusterLinks();
ByteBuf buf = Unpooled.directBuffer();
command.encode(buf);

assertThat(buf.toString(StandardCharsets.UTF_8)).isEqualTo("*2\r\n$7\r\nCLUSTER\r\n$5\r\nLINKS\r\n");
}

}

0 comments on commit 8ad4121

Please sign in to comment.