diff --git a/src/test/java/io/redis/test/utils/EnabledOnCommandRule.java b/src/test/java/io/redis/test/utils/EnabledOnCommandRule.java index d32152341f..ef88f96b69 100644 --- a/src/test/java/io/redis/test/utils/EnabledOnCommandRule.java +++ b/src/test/java/io/redis/test/utils/EnabledOnCommandRule.java @@ -99,9 +99,8 @@ private EnabledOnCommand getMethodAnnotation(Description description) { */ private boolean isCommandAvailable(Jedis jedisClient, String command, String subCommand) { try { - Object raw = jedisClient.sendCommand(redis.clients.jedis.Protocol.Command.COMMAND); - Map commandList = BuilderFactory.COMMAND_INFO_RESPONSE.build(raw); - CommandInfo commandInfo = commandList.get(command.toLowerCase()); + Map commandInfoMap= jedisClient.commandInfo(command); + CommandInfo commandInfo = commandInfoMap.get(command.toLowerCase()); if (commandInfo != null) { // If a subCommand is provided, check for the subcommand under this command if (subCommand != null && !subCommand.isEmpty()) { @@ -117,8 +116,8 @@ private boolean isCommandAvailable(Jedis jedisClient, String command, String sub } return false; // Command not found } catch (Exception e) { - logger.error("Error checking command '{}' availability: {}", command, e.getMessage()); - return false; + String msg = String.format("Error found while EnableOnCommand for command '%s'", command); + throw new RuntimeException(msg, e); } } };