@Test(groups = "unit", dataProvider = "readStrong_RequestBarrierArgProvider")
public void readStrong_OnlySecondary_RequestBarrier_Success(int numberOfBarrierRequestTillCatchUp) {

    // scenario: we get lsn l1, l2 where l1 > l2
    // we do barrier request and send it to all replicas till we have two replicas with at least l1 lsn
    ReadMode readMode = ReadMode.Strong;
    int replicaCountToRead = 2;
    ISessionContainer sessionContainer = Mockito.mock(ISessionContainer.class);
    Uri primaryReplicaURI = Uri.create("primary");
    ImmutableList<Uri> secondaryReplicaURIs = ImmutableList.of(Uri.create("secondary1"), Uri.create("secondary2"));
    AddressSelectorWrapper addressSelectorWrapper = AddressSelectorWrapper.Builder.Simple.create()
            .withPrimary(primaryReplicaURI)
            .withSecondary(secondaryReplicaURIs)
            .build();
    RxDocumentServiceRequest request = RxDocumentServiceRequest.createFromName(
            OperationType.Read, "/dbs/db/colls/col/docs/docId", ResourceType.Document);
    request.requestContext = new DocumentServiceRequestContext();
    request.requestContext.timeoutHelper = Mockito.mock(TimeoutHelper.class);
    request.requestContext.resolvedPartitionKeyRange = Mockito.mock(PartitionKeyRange.class);
    request.requestContext.requestChargeTracker = new RequestChargeTracker();
    BigDecimal requestChargePerRead = new BigDecimal(1.1);
    BigDecimal requestChargePerHead = BigDecimal.ZERO;
    long expectedQuorumLsn = 53;
    long expectedQuorumLocalLSN = 20;
    StoreResponse primaryResponse = StoreResponseBuilder.create()
            .withLSN(expectedQuorumLsn - 2)
            .withLocalLSN(expectedQuorumLocalLSN - 2)
            .withRequestCharge(requestChargePerRead)
            .build();
    TransportClientWrapper.Builder.UriToResultBuilder builder = TransportClientWrapper.Builder.uriToResultBuilder()
            .storeResponseOn(primaryReplicaURI, OperationType.Read, ResourceType.Document, primaryResponse, false);
    // slow replica
    StoreResponse readResponse = StoreResponseBuilder.create()
            .withLSN(expectedQuorumLsn - 1)
            .withLocalLSN(expectedQuorumLocalLSN -1)
            .withRequestCharge(requestChargePerRead)
            .build();
    builder.storeResponseOn(secondaryReplicaURIs.get(0), OperationType.Read, ResourceType.Document, readResponse, false);
    for(int i = 0; i < numberOfBarrierRequestTillCatchUp; i++) {
        int lsnIncrement = (i == numberOfBarrierRequestTillCatchUp - 1) ? 1 : 0;
        readResponse = StoreResponseBuilder.create()
                .withLSN(expectedQuorumLsn - 1 + lsnIncrement)
                .withLocalLSN(expectedQuorumLocalLSN - 1 + lsnIncrement)
                .withRequestCharge(requestChargePerRead)
                .build();
        builder.storeResponseOn(secondaryReplicaURIs.get(0), OperationType.Read, ResourceType.Document, readResponse, false);
        StoreResponse headResponse = StoreResponseBuilder.create()
                .withLSN(expectedQuorumLsn - 1 + lsnIncrement)
                .withLocalLSN(expectedQuorumLocalLSN - 1 + lsnIncrement)
                .withRequestCharge(requestChargePerHead)
                .build();
        builder.storeResponseOn(secondaryReplicaURIs.get(0), OperationType.Head, ResourceType.DocumentCollection, headResponse, false);
    }
    // faster replica
    readResponse = StoreResponseBuilder.create()
            .withLSN(expectedQuorumLsn)
            .withLocalLSN(expectedQuorumLocalLSN)
            .withRequestCharge(requestChargePerRead)
            .build();
    builder.storeResponseOn(secondaryReplicaURIs.get(1), OperationType.Read, ResourceType.Document, readResponse, false);
    for(int i = 0; i < numberOfBarrierRequestTillCatchUp; i++) {
        StoreResponse headResponse = StoreResponseBuilder.create()
                .withLSN(expectedQuorumLsn + 10 * (i + 1))
                .withLocalLSN(expectedQuorumLocalLSN + 10 * (i + 1))
                .withRequestCharge(requestChargePerHead)
                .build();
        builder.storeResponseOn(secondaryReplicaURIs.get(1), OperationType.Head, ResourceType.DocumentCollection, headResponse, false);
    }
    TransportClientWrapper transportClientWrapper = builder.build();
    StoreReader storeReader = new StoreReader(transportClientWrapper.transportClient, addressSelectorWrapper.addressSelector, sessionContainer);
    GatewayServiceConfigurationReader serviceConfigurator = Mockito.mock(GatewayServiceConfigurationReader.class);
    IAuthorizationTokenProvider authTokenProvider = Mockito.mock(IAuthorizationTokenProvider.class);
    QuorumReader quorumReader = new QuorumReader(configs, transportClientWrapper.transportClient, addressSelectorWrapper.addressSelector, storeReader, serviceConfigurator, authTokenProvider);
    int expectedNumberOfReads = 2;
    int expectedNumberOfHeads = 2 * numberOfBarrierRequestTillCatchUp;
    double expectedRequestCharge = requestChargePerRead.multiply(BigDecimal.valueOf(expectedNumberOfReads)).add(
            requestChargePerHead.multiply(BigDecimal.valueOf(expectedNumberOfHeads))).setScale(4, RoundingMode.FLOOR).doubleValue();
    Stopwatch stopwatch = Stopwatch.createStarted();
    Single<StoreResponse> storeResponseSingle = quorumReader.readStrongAsync(request, replicaCountToRead, readMode);
    StoreResponseValidator validator = StoreResponseValidator.create()
            .withBELSN(expectedQuorumLsn)
            .withRequestCharge(expectedRequestCharge)
            .build();
    validateSuccess(storeResponseSingle, validator);
    assertThat(stopwatch.elapsed().plus(timeResolution)).isGreaterThanOrEqualTo(Duration.ofMillis(
            numberOfBarrierRequestTillCatchUp * configs.getDelayBetweenReadBarrierCallsInMs()));
    transportClientWrapper.validate()
            .verifyNumberOfInvocations(expectedNumberOfReads + expectedNumberOfHeads);
    addressSelectorWrapper.validate()
            .verifyNumberOfForceCachRefresh(0)
            .verifyVesolvePrimaryUriAsyncCount(0)
            .verifyTotalInvocations(1 + numberOfBarrierRequestTillCatchUp);
    AddressSelectorWrapper.InOrderVerification.Verifier addressSelectorVerifier = AddressSelectorWrapper.InOrderVerification.Verifier.builder()
            .resolveAllUriAsync_IncludePrimary(false)
            .resolveAllUriAsync_ForceRefresh(false)
            .build();
    addressSelectorWrapper.getInOrderVerification()
            .verifyNumberOfInvocations(1 + numberOfBarrierRequestTillCatchUp)
            .verifyOnAll(addressSelectorVerifier);
    DocumentServiceRequestValidator requestValidator = DocumentServiceRequestValidator.builder()
            .add(DocumentServiceRequestContextValidator.builder()
                         .qurorumSelectedLSN(0l)
                         .globalCommittedSelectedLSN(0l)
                         .storeResponses(null)
                         .build())
            .build();
    requestValidator.validate(request);
}