pivotal-eshu commented on a change in pull request #5901:
URL: https://github.com/apache/geode/pull/5901#discussion_r567032550
##########
File path:
geode-core/src/test/java/org/apache/geode/internal/cache/tx/PartitionedTXRegionStubTest.java
##########
@@ -127,6 +129,36 @@ public void
destroyExistingEntryThrowsTransactionDataNodeHasDepartedExceptionIfI
verify(stub, never()).trackBucketForTx(keyInfo);
}
+ @Test
+ public void getEntryForIteratorReturnsEntryGotFromLocal() throws Exception {
+ PartitionedTXRegionStub stub = spy(new
PartitionedTXRegionStub(txStateStub, partitionedRegion));
+ EntrySnapshot entry = mock(EntrySnapshot.class);
+
+ when(event.getRegion()).thenReturn(partitionedRegion);
+ when(partitionedRegion.getBucketPrimary(1))
+ .thenReturn((InternalDistributedMember) remoteTransactionHost);
+ when(partitionedRegion.getEntryRemotely((InternalDistributedMember)
remoteTransactionHost, 1,
+ key, false, true)).thenReturn(entry);
+
+ assertThat(stub.getEntryForIterator(keyInfo, true)).isEqualTo(entry);
+ verify(stub).trackBucketForTx(keyInfo);
+ }
+
+ @Test
+ public void getEntryForIteratorReturnsEntryGotFromRemote() throws Exception {
Review comment:
Similarly getEntryForIteratorReturnsEntryGotFromAnyDataHosts is more
appropriate here.
Also the method does not throw Exception, please remove it to avoid warnings.
----------------------------------------------------------------
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]