Geode-8853: DUNIT tests for HSTRLEN command#5939
Geode-8853: DUNIT tests for HSTRLEN command#5939jdeppe-pivotal merged 8 commits intoapache:developfrom ringles:GEODE-8853-integration-tests-HSTRLEN
Conversation
sabbey37
left a comment
There was a problem hiding this comment.
It seems good! I always worry there are scenarios I'm forgetting about.
| @Test | ||
| public void testHStrlen_givenWrongNumberOfArguments() { | ||
| assertThatThrownBy(() -> jedis.sendCommand(Protocol.Command.HSTRLEN)) | ||
| .hasMessageContaining("wrong number of arguments"); | ||
| assertThatThrownBy(() -> jedis.sendCommand(Protocol.Command.HSTRLEN, "1")) | ||
| .hasMessageContaining("wrong number of arguments"); | ||
| assertThatThrownBy(() -> jedis.sendCommand(Protocol.Command.HSTRLEN, "1", "2", "3")) | ||
| .hasMessageContaining("wrong number of arguments"); | ||
| } | ||
|
|
There was a problem hiding this comment.
Thanks for adding these! I made this comment in the HSETNX PR as well:
I know for most of the other commands (del, getset, exists, etc.) we check the error message more closely, like:
.hasMessage("ERR wrong number of arguments for 'get' command");
I'm not sure if it's necessary, but maybe we could do the same here to be consistent? I realize there are a few areas where we're still just checking wrong number of arguments. We could eventually change those in a different PR.
There was a problem hiding this comment.
Did we want to change this? Or create a different PR for it? Or not change it? Or something else?
There was a problem hiding this comment.
I second this. It would be pretty awkward to return an error message for the wrong command
- test the error messages for hgetall and hstrlen more specifically - fix an hgetall test that was testing the wrong command
- test the error messages for hgetall and hstrlen more specifically - fix an hgetall test that was testing the wrong command Co-authored-by: Ray Ingles <ringles@vmware.com> Co-authored-by: Helena A. Bales <hbales@pivotal.io>
Add DUNIT test for HSTRLEN Redis command, promote to "supported".