sashapolo commented on code in PR #5659:
URL: https://github.com/apache/ignite-3/pull/5659#discussion_r2048726877


##########
modules/partition-replicator/src/main/java/org/apache/ignite/internal/partition/replicator/PartitionReplicaLifecycleManager.java:
##########
@@ -1703,4 +1703,9 @@ public HybridTimestamp 
currentSafeTimeForZonePartition(int zoneId, int partId) {
         return 
requireNonNull(zoneResourcesManager.getZonePartitionResources(new 
ZonePartitionId(zoneId, partId))).raftListener()
                 .currentSafeTime();
     }
+
+    @TestOnly
+    public CompletableFuture<ZonePartitionReplicaListener> 
zonePartitionResourcesReplicaFuture(ZonePartitionId zonePartitionId) {
+        return 
zoneResourcesManager.getZonePartitionResources(zonePartitionId).replicaListenerFuture();

Review Comment:
   Could you please extract the whole `getZonePartitionResources` method 
instead? I will need it in my other PR as well.



##########
modules/table/src/test/java/org/apache/ignite/internal/table/distributed/TableManagerRecoveryTest.java:
##########
@@ -332,9 +334,17 @@ private void startComponents() throws Exception {
 
         doReturn(nullCompletedFuture())
                 
.when(replicaMgr).startReplica(any(RaftGroupEventsListener.class), any(), 
anyBoolean(), any(), any(), any(), any(), any());
-        doReturn(nullCompletedFuture())
-                .when(replicaMgr)
-                .startReplica(any(ReplicationGroupId.class), any(), any(), 
any(), any(), any(), anyBoolean(), any(), any());
+
+        ZonePartitionReplicaListener zonePartitionReplicaListener = 
mock(ZonePartitionReplicaListener.class);
+        Replica replica = mock(Replica.class);
+        doAnswer(invocation -> {

Review Comment:
   Why do we use this backward mocking approach here? Is `replicaMgr` a spy 
object? I'm pretty sure that it's not and we can mock normally with 
`when().then()`



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