@Test(groups = "unit")
public void readStrong_QuorumNotSelected_ReadPrimary() {

    // scenario: attempts to read from secondaries,
    // only one secondary is available so ends in QuorumNotSelected State
    // reads from Primary and succeeds
    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"));
    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;
    TransportClientWrapper.Builder.UriToResultBuilder builder = TransportClientWrapper.Builder.uriToResultBuilder();
    long primaryLSN = 52;
    long primaryLocalLSN = 19;
    StoreResponse headResponse = StoreResponseBuilder.create()
            .withLSN(primaryLSN)
            .withLocalLSN(primaryLocalLSN)
            .withHeader(WFConstants.BackendHeaders.CURRENT_REPLICA_SET_SIZE, "2")
            .withHeader(WFConstants.BackendHeaders.QUORUM_ACKED_LSN, Long.toString(primaryLSN))
            .withHeader(WFConstants.BackendHeaders.QUORUM_ACKED_LOCAL_LSN, Long.toString(primaryLocalLSN))
            .withRequestCharge(requestChargePerRead)
            .build();
    builder.storeResponseOn(primaryReplicaURI, OperationType.Read, ResourceType.Document, headResponse, false);
    StoreResponse readResponse = StoreResponseBuilder.create()
            .withLSN(primaryLSN)
            .withLocalLSN(primaryLocalLSN)
            .withRequestCharge(requestChargePerRead)
            .build();
    builder.storeResponseOn(secondaryReplicaURIs.get(0), OperationType.Read, ResourceType.Document, readResponse, 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);
    double expectedRequestCharge = requestChargePerRead.multiply(BigDecimal.valueOf(1))
            .add(requestChargePerHead.multiply(BigDecimal.valueOf(0)))
            .setScale(4, RoundingMode.FLOOR).doubleValue();
    Single<StoreResponse> storeResponseSingle = quorumReader.readStrongAsync(request, replicaCountToRead, readMode);
    StoreResponseValidator validator = StoreResponseValidator.create()
            .withBELSN(primaryLSN)
            .withBELocalLSN(primaryLocalLSN)
            .withRequestCharge(expectedRequestCharge)
            .build();
    validateSuccess(storeResponseSingle, validator);
    transportClientWrapper.validate()
            .verifyNumberOfInvocations(1);
    addressSelectorWrapper.validate()
            .verifyNumberOfForceCachRefresh(0)
            .verifyVesolvePrimaryUriAsyncCount(1)
            .verifyTotalInvocations(2);
    AddressSelectorWrapper.InOrderVerification.Verifier primaryNotIncludedVerifier = AddressSelectorWrapper
            .InOrderVerification.Verifier.builder()
            .resolveAllUriAsync_IncludePrimary(false)
            .resolveAllUriAsync_ForceRefresh(false)
            .build();
    AddressSelectorWrapper.InOrderVerification.Verifier resolvePrimaryVerifier = AddressSelectorWrapper
            .InOrderVerification.Verifier.builder()
            .resolvePrimaryUriAsync()
            .build();
    AddressSelectorWrapper.InOrderVerification ov = addressSelectorWrapper.getInOrderVerification();
    ov.verifyNext(primaryNotIncludedVerifier);
    ov.verifyNext(resolvePrimaryVerifier);
    DocumentServiceRequestValidator requestValidator = DocumentServiceRequestValidator.builder()
            .add(DocumentServiceRequestContextValidator.builder()
                         .qurorumSelectedLSN(0l)
                         .globalCommittedSelectedLSN(0l)
                         .storeResponses(null)
                         .build())
            .build();
    requestValidator.validate(request);
}