@Test public void getPathsShouldReturnUsedUrls() { MailRepositoryPath path1 = MailRepositoryPath.from("repo1"); MailRepositoryPath path2 = MailRepositoryPath.from("repo1"); MailRepositoryPath path3 = MailRepositoryPath.from("repo1"); repositoryStore.select(MailRepositoryUrl.fromPathAndProtocol(path1, "memory1")); repositoryStore.select(MailRepositoryUrl.fromPathAndProtocol(path2, "memory1")); repositoryStore.select(MailRepositoryUrl.fromPathAndProtocol(path3, "memory1")); assertThat(repositoryStore.getPaths()).containsOnly(path1, path2, path3); }
@Override public MailRepository select(MailRepositoryUrl mailRepositoryUrl) { return destinationToRepositoryAssociations.computeIfAbsent(mailRepositoryUrl, Throwing.function(this::createNewMailRepository).sneakyThrow()); }
MemoryMailRepositoryStore implements MailRepositoryStore, Startable { @Override public MailRepository select(MailRepositoryUrl mailRepositoryUrl) { return destinationToRepositoryAssociations.computeIfAbsent(mailRepositoryUrl, Throwing.function(this::createNewMailRepository).sneakyThrow()); } }
MemoryMailRepositoryStore implements MailRepositoryStore, Startable { @Override public MailRepository select(MailRepositoryUrl mailRepositoryUrl) { return destinationToRepositoryAssociations.computeIfAbsent(mailRepositoryUrl, Throwing.function(this::createNewMailRepository).sneakyThrow()); } @Inject  MemoryMailRepositoryStore(MailRepositoryUrlStore urlStore, MailRepositoryLoader mailRepositoryLoader, MailRepositoryStoreConfiguration configuration); }
MemoryMailRepositoryStore implements MailRepositoryStore, Startable { @Override public MailRepository select(MailRepositoryUrl mailRepositoryUrl) { return destinationToRepositoryAssociations.computeIfAbsent(mailRepositoryUrl, Throwing.function(this::createNewMailRepository).sneakyThrow()); } @Inject  MemoryMailRepositoryStore(MailRepositoryUrlStore urlStore, MailRepositoryLoader mailRepositoryLoader, MailRepositoryStoreConfiguration configuration); @Override Optional<Protocol> defaultProtocol(); void init(); @Override Stream<MailRepositoryUrl> getUrls(); @Override Optional<MailRepository> get(MailRepositoryUrl url); @Override Stream<MailRepository> getByPath(MailRepositoryPath path); @Override MailRepository select(MailRepositoryUrl mailRepositoryUrl); }
MemoryMailRepositoryStore implements MailRepositoryStore, Startable { @Override public MailRepository select(MailRepositoryUrl mailRepositoryUrl) { return destinationToRepositoryAssociations.computeIfAbsent(mailRepositoryUrl, Throwing.function(this::createNewMailRepository).sneakyThrow()); } @Inject  MemoryMailRepositoryStore(MailRepositoryUrlStore urlStore, MailRepositoryLoader mailRepositoryLoader, MailRepositoryStoreConfiguration configuration); @Override Optional<Protocol> defaultProtocol(); void init(); @Override Stream<MailRepositoryUrl> getUrls(); @Override Optional<MailRepository> get(MailRepositoryUrl url); @Override Stream<MailRepository> getByPath(MailRepositoryPath path); @Override MailRepository select(MailRepositoryUrl mailRepositoryUrl);  }