BlobStoreCacheModulesChooser { public static List<Module> chooseModules(BlobStoreConfiguration blobStoreConfiguration) { if (blobStoreConfiguration.cacheEnabled()) { return ImmutableList.of(new CassandraCacheSessionModule(), new CacheEnabledModule()); } return ImmutableList.of(new CacheDisabledModule()); }  static List<Module> chooseModules(BlobStoreConfiguration blobStoreConfiguration);  }
@Test void chooseModulesShouldReturnCacheDisabledModuleWhenCacheDisabled() { assertThat(BlobStoreCacheModulesChooser.chooseModules(BlobStoreConfiguration.builder() .s3() .disableCache() .deduplication())) .hasSize(1) .first() .isInstanceOf(BlobStoreCacheModulesChooser.CacheDisabledModule.class); }
@Test void chooseModulesShouldReturnCacheEnabledAndCassandraCacheModulesWhenCacheEnabled() { assertThat(BlobStoreCacheModulesChooser.chooseModules(BlobStoreConfiguration.builder() .s3() .enableCache() .deduplication())) .hasSize(2) .allSatisfy(module -> assertThat(module).isOfAnyClassIn( BlobStoreCacheModulesChooser.CacheEnabledModule.class, CassandraCacheSessionModule.class)); }