@Test
  public void testHasCompletedReplicationErrorCases() {
    PartitionId mockPartition = mock(PartitionId.class);
    Store mockStore = mock(Store.class);

    // Case 1: Store is null
    when(storageManager.getStore(mockPartition)).thenReturn(null);
    assertTrue("Replication should be considered complete if store is null", manager.hasCompletedReplication(mockPartition));

    // Case 2: Store is not started
    when(storageManager.getStore(mockPartition)).thenReturn(mockStore);
    when(mockStore.isStarted()).thenReturn(false);
    assertTrue("Replication should be considered complete if store is not started", manager.hasCompletedReplication(mockPartition));

    // Case 3: Store is started but state is null
    when(mockStore.isStarted()).thenReturn(true);
    when(mockStore.getCurrentState()).thenReturn(null);
    assertTrue("Replication should be considered complete if replica state is null", manager.hasCompletedReplication(mockPartition));

    // Case 4: Store is started and state is STANDBY
    when(mockStore.getCurrentState()).thenReturn(ReplicaState.STANDBY);
    assertTrue("Replication should be complete if state is STANDBY", manager.hasCompletedReplication(mockPartition));

    // Case 5: Store is started and state is LEADER
    when(mockStore.getCurrentState()).thenReturn(ReplicaState.LEADER);
    assertTrue("Replication should be complete if state is LEADER", manager.hasCompletedReplication(mockPartition));

    // Case 6: Store is started and state is ERROR
    when(mockStore.getCurrentState()).thenReturn(ReplicaState.ERROR);
    assertTrue("Replication should be complete if state is ERROR", manager.hasCompletedReplication(mockPartition));

    // Case 7: Store is started and state is BOOTSTRAP
    when(mockStore.getCurrentState()).thenReturn(ReplicaState.BOOTSTRAP);
    assertFalse("Replication should not be complete if state is BOOTSTRAP", manager.hasCompletedReplication(mockPartition));
  }
Test when initially all partitions are in BOOTSTRAP state and some are disabled.
In next run some partitions complete replication and there are no further bootstrapping partitions
Then disabled partitions should be enabled.
ambry-prioritization/src/test/java/com/github/ambry/replica/prioritization/ReplicationPrioritizationManagerTest.java