[ https://issues.apache.org/jira/browse/GEODE-8269?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17138538#comment-17138538 ]
ASF GitHub Bot commented on GEODE-8269: --------------------------------------- sabbeyPivotal commented on a change in pull request #5262: URL: https://github.com/apache/geode/pull/5262#discussion_r441615964 ########## File path: geode-redis/src/test/java/org/apache/geode/redis/internal/executor/key/ExpireAtExecutorJUnitTest.java ########## @@ -34,30 +37,30 @@ @Test public void calledWithTooFewCommandArguments_returnsError() { - List<byte[]> commandsAsBytesWithTooFewArguments = new ArrayList<>(); - commandsAsBytesWithTooFewArguments.add("EXPIREAT".getBytes()); - commandsAsBytesWithTooFewArguments.add("key".getBytes()); - Command command = new Command(commandsAsBytesWithTooFewArguments); + List<byte[]> commandAsBytes = new ArrayList<>(); + commandAsBytes.add("EXPIREAT".getBytes()); + commandAsBytes.add("key".getBytes()); + Command command = new Command(commandAsBytes); - RedisResponse response = - new ExpireAtExecutor().executeCommand(command, mockContext()); + Throwable thrown = catchThrowable(() -> command.execute(mockContext())); - assertThat(response.toString()).startsWith("-ERR The wrong number of arguments"); + AssertionsForClassTypes.assertThat(thrown).hasMessageContaining("wrong number of arguments"); + AssertionsForClassTypes.assertThat(thrown).isInstanceOf(RedisParametersMismatchException.class); } @Test public void calledWithTooManyCommandArguments_returnsError() { - List<byte[]> commandsAsBytesWithTooFewArguments = new ArrayList<>(); - commandsAsBytesWithTooFewArguments.add("EXPIREAT".getBytes()); - commandsAsBytesWithTooFewArguments.add("key".getBytes()); - commandsAsBytesWithTooFewArguments.add("1".getBytes()); - commandsAsBytesWithTooFewArguments.add("extra-argument".getBytes()); - Command command = new Command(commandsAsBytesWithTooFewArguments); + List<byte[]> commandsAsBytes = new ArrayList<>(); + commandsAsBytes.add("EXPIREAT".getBytes()); + commandsAsBytes.add("key".getBytes()); + commandsAsBytes.add("1".getBytes()); + commandsAsBytes.add("extra-argument".getBytes()); + Command command = new Command(commandsAsBytes); - RedisResponse response = - new ExpireAtExecutor().executeCommand(command, mockContext()); + Throwable thrown = catchThrowable(() -> command.execute(mockContext())); - assertThat(response.toString()).startsWith("-ERR The wrong number of arguments"); + AssertionsForClassTypes.assertThat(thrown).hasMessageContaining("wrong number of arguments"); + AssertionsForClassTypes.assertThat(thrown).isInstanceOf(RedisParametersMismatchException.class); Review comment: Definitely. Editing those now. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Improve test coverage > --------------------- > > Key: GEODE-8269 > URL: https://issues.apache.org/jira/browse/GEODE-8269 > Project: Geode > Issue Type: Test > Components: redis, tests > Reporter: Sarah Abbey > Priority: Major > > Analyzed test coverage via Intellij and by looking through all tests. There > were some test cases missing. We either added them or created additional > stories in Tracker. -- This message was sent by Atlassian Jira (v8.3.4#803005)