jujoramos commented on a change in pull request #6100:
URL: https://github.com/apache/geode/pull/6100#discussion_r592190909
##########
File path:
geode-membership/src/integrationTest/java/org/apache/geode/distributed/internal/membership/gms/membership/GMSJoinLeaveJUnitTest.java
##########
@@ -848,6 +848,21 @@ private InstallViewMessage
getInstallViewMessage(GMSMembershipView view, Object
return installViewMessage;
}
+ @Test
+ public void testNetworkPartitionDetectedWithNullView() throws Exception {
+ initMocks(true);
+ prepareAndInstallView(mockMembers[0], createMemberList(mockMembers[0],
gmsJoinLeaveMemberId));
+
+ NetworkPartitionMessage message = new NetworkPartitionMessage();
+ message.setSender(gmsJoinLeaveMemberId);
+
+
+ // this creates a NPE that must be handled appropriately
+ gmsJoinLeave.currentView = null;
+ gmsJoinLeave.processNetworkPartitionMessage(message);
Review comment:
Nitpick: maybe use `assertThatCode(() ->
gmsJoinLeave.processNetworkPartitionMessage(message)).doesNotThrowAnyException();`
to make the test more explicit instead?.
----------------------------------------------------------------
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]