DonalEvans commented on a change in pull request #6613:
URL: https://github.com/apache/geode/pull/6613#discussion_r651936440



##########
File path: 
geode-core/src/test/java/org/apache/geode/internal/cache/LatestLastAccessTimeMessageTest.java
##########
@@ -77,6 +78,19 @@ public void processWithNullCacheRepliesZero() {
     verify(lastAccessTimeMessage).sendReply(dm, 0);
   }
 
+  @Test
+  public void replyIsSentEvenIfThereIsAnException() {
+    setupMessage();
+    when(dm.getCache()).thenThrow(new RuntimeException());
+    try {
+      lastAccessTimeMessage.process(dm);
+      fail();
+    } catch (RuntimeException ex) {
+      // Expected
+    }

Review comment:
       Rather than using `fail()` and catching the exception just to ignore it, 
it might be better to extract the `new RuntimeException()` to a variable and 
then use `assertThatThrownBy()` to confirm that that exception is thrown.




-- 
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:
[email protected]


Reply via email to