Skip to content

Commit af744e9

Browse files
committed
fix TransportReplicationActionTests
1 parent de3f416 commit af744e9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

server/src/test/java/org/elasticsearch/action/support/replication/TransportReplicationActionTests.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
import org.elasticsearch.index.Index;
5555
import org.elasticsearch.index.IndexNotFoundException;
5656
import org.elasticsearch.index.IndexService;
57+
import org.elasticsearch.index.seqno.SequenceNumbers;
5758
import org.elasticsearch.index.shard.IndexShard;
5859
import org.elasticsearch.index.shard.IndexShardClosedException;
5960
import org.elasticsearch.index.shard.IndexShardState;
@@ -931,6 +932,8 @@ public void testSeqNoIsSetOnPrimary() {
931932
when(shard.getPendingPrimaryTerm()).thenReturn(primaryTerm);
932933
when(shard.routingEntry()).thenReturn(routingEntry);
933934
when(shard.isRelocatedPrimary()).thenReturn(false);
935+
when(shard.getLocalCheckpointSupplier()).thenReturn(() -> SequenceNumbers.UNASSIGNED_SEQ_NO);
936+
when(shard.getLastSyncedGlobalCheckpointSupplier()).thenReturn(() -> SequenceNumbers.UNASSIGNED_SEQ_NO);
934937
IndexShardRoutingTable shardRoutingTable = clusterService.state().routingTable().shardRoutingTable(shardId);
935938
Set<String> inSyncIds = randomBoolean()
936939
? singleton(routingEntry.allocationId().getId())
@@ -1631,7 +1634,8 @@ private IndexShard mockIndexShard(ShardId shardId, ClusterService clusterService
16311634
when(indexShard.getPendingPrimaryTerm()).thenAnswer(
16321635
i -> clusterService.state().metadata().getProject().getIndexSafe(shardId.getIndex()).primaryTerm(shardId.id())
16331636
);
1634-
1637+
when(indexShard.getLocalCheckpointSupplier()).thenReturn(() -> SequenceNumbers.UNASSIGNED_SEQ_NO);
1638+
when(indexShard.getLastSyncedGlobalCheckpointSupplier()).thenReturn(() -> SequenceNumbers.UNASSIGNED_SEQ_NO);
16351639
ReplicationGroup replicationGroup = mock(ReplicationGroup.class);
16361640
when(indexShard.getReplicationGroup()).thenReturn(replicationGroup);
16371641
return indexShard;

0 commit comments

Comments
 (0)