BlobStoreModulesChooser { @VisibleForTesting public static List<Module> chooseModules(BlobStoreConfiguration choosingConfiguration) { return ImmutableList.<Module>builder() .add(chooseBlobStoreDAOModule(choosingConfiguration.getImplementation())) .add(chooseStoragePolicyModule(choosingConfiguration.storageStrategy())) .add(new StoragePolicyConfigurationSanityEnforcementModule(choosingConfiguration)) .build(); }  @VisibleForTesting static List<Module> chooseModules(BlobStoreConfiguration choosingConfiguration); static Module chooseBlobStoreDAOModule(BlobStoreConfiguration.BlobStoreImplName implementation);  }
@Test void provideBlobStoreShouldReturnObjectStoreBlobStoreWhenObjectStoreConfigured() { assertThat(BlobStoreModulesChooser.chooseModules(BlobStoreConfiguration.builder() .s3() .disableCache() .deduplication())) .first() .isInstanceOf(BlobStoreModulesChooser.ObjectStorageBlobStoreDAODeclarationModule.class); }
@Test void provideBlobStoreShouldReturnCassandraBlobStoreWhenCassandraConfigured() { assertThat(BlobStoreModulesChooser.chooseModules(BlobStoreConfiguration.builder() .cassandra() .disableCache() .passthrough())) .first() .isInstanceOf(BlobStoreModulesChooser.CassandraBlobStoreDAODeclarationModule.class); }