@Test public void checkHealthyIfPathDuplicateInNorFileBlobStore() throws Exception { blobStores.add(generateBlobStore("other_type", "f_d", "/nexus/0")); assertThat(underTest.check().isHealthy(), is(true)); }
@Override @VisibleForTesting protected Result check() throws Exception { Iterable<BlobStore> blobStores = blobStoreManager.get().browse(); List<BlobStoreConfiguration> configs = StreamSupport.stream(blobStores.spliterator(), false) .map(BlobStore::getBlobStoreConfiguration) .filter(config -> config.getType().equals(FileBlobStore.TYPE)) .collect(Collectors.toList()); Set<BlobStoreConfiguration> pathDuplicates = extractPathDuplicates(configs); if (!pathDuplicates.isEmpty()) { return unhealthy(buildWarning(pathDuplicates)); } return healthy(); }
FileBlobStorePathValidator extends HealthCheck { @Override @VisibleForTesting protected Result check() throws Exception { Iterable<BlobStore> blobStores = blobStoreManager.get().browse(); List<BlobStoreConfiguration> configs = StreamSupport.stream(blobStores.spliterator(), false) .map(BlobStore::getBlobStoreConfiguration) .filter(config -> config.getType().equals(FileBlobStore.TYPE)) .collect(Collectors.toList()); Set<BlobStoreConfiguration> pathDuplicates = extractPathDuplicates(configs); if (!pathDuplicates.isEmpty()) { return unhealthy(buildWarning(pathDuplicates)); } return healthy(); } }
FileBlobStorePathValidator extends HealthCheck { @Override @VisibleForTesting protected Result check() throws Exception { Iterable<BlobStore> blobStores = blobStoreManager.get().browse(); List<BlobStoreConfiguration> configs = StreamSupport.stream(blobStores.spliterator(), false) .map(BlobStore::getBlobStoreConfiguration) .filter(config -> config.getType().equals(FileBlobStore.TYPE)) .collect(Collectors.toList()); Set<BlobStoreConfiguration> pathDuplicates = extractPathDuplicates(configs); if (!pathDuplicates.isEmpty()) { return unhealthy(buildWarning(pathDuplicates)); } return healthy(); } @Inject  FileBlobStorePathValidator(
      final Provider<BlobStoreManager> blobStoreManager,
      final Provider<ApplicationDirectories> applicationDirectories); }
FileBlobStorePathValidator extends HealthCheck { @Override @VisibleForTesting protected Result check() throws Exception { Iterable<BlobStore> blobStores = blobStoreManager.get().browse(); List<BlobStoreConfiguration> configs = StreamSupport.stream(blobStores.spliterator(), false) .map(BlobStore::getBlobStoreConfiguration) .filter(config -> config.getType().equals(FileBlobStore.TYPE)) .collect(Collectors.toList()); Set<BlobStoreConfiguration> pathDuplicates = extractPathDuplicates(configs); if (!pathDuplicates.isEmpty()) { return unhealthy(buildWarning(pathDuplicates)); } return healthy(); } @Inject  FileBlobStorePathValidator(
      final Provider<BlobStoreManager> blobStoreManager,
      final Provider<ApplicationDirectories> applicationDirectories); void validatePathUniqueConstraint(final BlobStoreConfiguration configuration); }
FileBlobStorePathValidator extends HealthCheck { @Override @VisibleForTesting protected Result check() throws Exception { Iterable<BlobStore> blobStores = blobStoreManager.get().browse(); List<BlobStoreConfiguration> configs = StreamSupport.stream(blobStores.spliterator(), false) .map(BlobStore::getBlobStoreConfiguration) .filter(config -> config.getType().equals(FileBlobStore.TYPE)) .collect(Collectors.toList()); Set<BlobStoreConfiguration> pathDuplicates = extractPathDuplicates(configs); if (!pathDuplicates.isEmpty()) { return unhealthy(buildWarning(pathDuplicates)); } return healthy(); } @Inject  FileBlobStorePathValidator(
      final Provider<BlobStoreManager> blobStoreManager,
      final Provider<ApplicationDirectories> applicationDirectories); void validatePathUniqueConstraint(final BlobStoreConfiguration configuration);  }