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

    IAddressResolver addressResolver = Mockito.mock(IAddressResolver.class);
    AddressSelector selector = new AddressSelector(addressResolver, Protocol.Https);
    RxDocumentServiceRequest request = Mockito.mock(RxDocumentServiceRequest.class);
    Mockito.doReturn(null).when(request).getDefaultReplicaIndex();
    List<AddressInformation>  replicaAddresses = new ArrayList<>();
    replicaAddresses.add(new AddressInformation(true, false, "https://cosmos4", Protocol.Tcp));
    replicaAddresses.add(new AddressInformation(true, true, "https://cosmos5", Protocol.Tcp));
    replicaAddresses.add(new AddressInformation(true, false, "https://cosmos1", Protocol.Https));
    replicaAddresses.add(new AddressInformation(true, true, "https://cosmos2", Protocol.Https));
    replicaAddresses.add(new AddressInformation(true, false, "https://cosmos3", Protocol.Https));
    Mockito.doReturn(Single.just(replicaAddresses.toArray(new AddressInformation[0]))).when(addressResolver).resolveAsync(Mockito.any(RxDocumentServiceRequest.class), Matchers.eq(false));
    List<Uri> res = selector.resolveAllUriAsync(request, true, false).toBlocking().value();
    assertThat(res).isEqualTo(ImmutableList.of(Uri.create("https://cosmos1/"), Uri.create("https://cosmos2/"), Uri.create("https://cosmos3/")));
}