You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@geode.apache.org by GitBox <gi...@apache.org> on 2021/01/29 22:31:42 UTC

[GitHub] [geode] kirklund commented on a change in pull request #5979: GEODE-8895: processChunkResponse encountering broken socket should th…

kirklund commented on a change in pull request #5979:
URL: https://github.com/apache/geode/pull/5979#discussion_r567129577



##########
File path: geode-core/src/test/java/org/apache/geode/cache/client/internal/AbstractOpTest.java
##########
@@ -37,4 +43,39 @@ public void shouldBeMockable() throws Exception {
     assertThat(mockAbstractOp.processObjResponse(mock(Message.class), "string"))
         .isEqualTo(mockObject);
   }
+
+  @Test(expected = IOException.class)
+  public void processChunkedResponseShouldThrowIOExceptionWhenSocketBroken() throws Exception {
+    ChunkedMessage msg = mock(ChunkedMessage.class);
+    AbstractOp abstractOp = new AbstractOp(MessageType.PING, 0) {

Review comment:
       I think you can lean more on Mockito here instead of constructing an anonymous class. Something like:
   ```
   AbstractOp abstractOp = spy(AbstractOp.class);
   ```
   That should produce the same effect as your anonymous class.




----------------------------------------------------------------
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:
users@infra.apache.org