pivotal-jbarrett commented on a change in pull request #7546:
URL: https://github.com/apache/geode/pull/7546#discussion_r840977402



##########
File path: 
geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/Put70Test.java
##########
@@ -307,10 +317,44 @@ public void 
shouldSetPossibleDuplicateReturnsFalseIfNotRecoveredVersionTagAndNoP
   public void 
shouldSetPossibleDuplicateReturnsTrueIfNotRecoveredVersionTagAndWithPersistence()
 {
     Put70 spy = Mockito.spy(put70);
     when(attributes.getConcurrencyChecksEnabled()).thenReturn(true);
-    when(dataPolicy.withPersistence()).thenReturn(true);
     
doReturn(false).when(spy).recoverVersionTagForRetriedOperation(clientEvent);
+    doReturn(true).when(spy).isRegionWithPersistence(localRegion);
 
     assertThat(spy.shouldSetPossibleDuplicate(localRegion, 
clientEvent)).isTrue();
   }
 
+  @Test
+  public void isRegionWithPersistenceReturnsTrueIfDataPolicyWithPersistence() {
+    when(dataPolicy.withPersistence()).thenReturn(true);
+
+    assertThat(put70.isRegionWithPersistence(localRegion)).isTrue();
+  }
+
+  @Test
+  public void 
isRegionWithPersistenceReturnsTrueIfIsAccessorAndHavingPersistentMembers() {
+    when(dataPolicy.withPersistence()).thenReturn(false);
+    when(partitionedRegion.isDataStore()).thenReturn(false);
+    when(partitionedRegion.getRegionAdvisor()).thenReturn(regionAdvisor);
+    
when(regionAdvisor.advisePersistentMembers()).thenReturn(uncheckedCast(mock(Map.class)));

Review comment:
       Since you aren't mocking it, perhaps `Collections.emptyMap()`?

##########
File path: 
geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/Put70.java
##########
@@ -463,13 +464,13 @@ public void cmdExecute(final @NotNull Message 
clientMessage,
 
   }
 
+  @VisibleForTesting

Review comment:
       Package protected is not really "visible for testing" but rather a 
necessity for testing. I don't think we need to tag all these.

##########
File path: 
geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/Put70Test.java
##########
@@ -25,6 +25,8 @@
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
+import java.util.Map;
+
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;

Review comment:
       Please update the test to JUnit 5.




-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to