Skip to content

Commit

Permalink
Merge branch 'master' into migrate_to_clients_test_image
Browse files Browse the repository at this point in the history
  • Loading branch information
uglide authored Nov 22, 2024
2 parents 83cf38d + eb6cc47 commit accfea2
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main/java/redis/clients/jedis/Jedis.java
Original file line number Diff line number Diff line change
Expand Up @@ -8253,6 +8253,12 @@ public Map<String, CommandInfo> commandInfo(String... commands) {
return CommandInfo.COMMAND_INFO_RESPONSE.build(connection.getOne());
}

public Map<String, CommandInfo> command() {
checkIsInMultiOrPipeline();
connection.sendCommand(COMMAND);
return CommandInfo.COMMAND_INFO_RESPONSE.build(connection.getOne());
}

public List<String> commandList() {
checkIsInMultiOrPipeline();
connection.sendCommand(COMMAND, LIST);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,28 @@ public void commandGetKeysAndFlags() {
assertEquals(2, keySandFlags.get(0).getValue().size());
}


@Test
public void commandNoArgs() {
Map<String, CommandInfo> infos = jedis.command();

assertThat(infos.size(), greaterThan(0));

CommandInfo getInfo = infos.get("get");
assertEquals(2, getInfo.getArity());
assertEquals(2, getInfo.getFlags().size());
assertEquals(1, getInfo.getFirstKey());
assertEquals(1, getInfo.getLastKey());
assertEquals(1, getInfo.getStep());

assertNull(infos.get("foo")); // non-existing command

CommandInfo setInfo = infos.get("set");
assertEquals(3, setInfo.getAclCategories().size());
assertEquals(0, setInfo.getTips().size());
assertEquals(0, setInfo.getSubcommands().size());
}

@Test
public void commandInfo() {
Map<String, CommandInfo> infos = jedis.commandInfo("GET", "foo", "SET");
Expand Down

0 comments on commit accfea2

Please sign in to comment.