@Test(groups = "unit", dataProvider = "deduceReadModeArgProvider")
public void deduceReadMode(ConsistencyLevel accountConsistencyLevel, ConsistencyLevel requestConsistency, ReadMode expectedReadMode,
                           ConsistencyLevel expectedConsistencyToUse, boolean expectedToUseSession) throws DocumentClientException {

    AddressSelector addressSelector = Mockito.mock(AddressSelector.class);
    ISessionContainer sessionContainer = Mockito.mock(ISessionContainer.class);
    TransportClient transportClient = Mockito.mock(TransportClient.class);
    GatewayServiceConfiguratorReaderMock gatewayServiceConfigurationReaderWrapper = GatewayServiceConfiguratorReaderMock.from(accountConsistencyLevel);
    IAuthorizationTokenProvider authorizationTokenProvider = Mockito.mock(IAuthorizationTokenProvider.class);
    ConsistencyReader consistencyReader = new ConsistencyReader(configs,
                                                                addressSelector,
                                                                sessionContainer,
                                                                transportClient,
                                                                gatewayServiceConfigurationReaderWrapper.gatewayServiceConfigurationReader,
                                                                authorizationTokenProvider);
    RxDocumentServiceRequest request = RxDocumentServiceRequest.createFromName(
            OperationType.Read, "/dbs/db/colls/col/docs/docId", ResourceType.Document);
    if (requestConsistency != null) {
        request.getHeaders().put(HttpConstants.HttpHeaders.CONSISTENCY_LEVEL, requestConsistency.name());
    }
    ValueHolder<ConsistencyLevel> consistencyLevel = ValueHolder.initialize(null);
    ValueHolder<Boolean> useSession = ValueHolder.initialize(null);
    ReadMode readMode = consistencyReader.deduceReadMode(request, consistencyLevel, useSession);
    assertThat(readMode).isEqualTo(expectedReadMode);
    assertThat(consistencyLevel.v).isEqualTo(expectedConsistencyToUse);
    assertThat(useSession.v).isEqualTo(expectedToUseSession);
}