@Test public void should_fail_when_storing_in_workSpace() throws Exception { willThrow(ContentAddressableStorageServerException.class).given(workspaceClient).createContainer(any()); final String description = "Unable to store file in workSpace"; assertThatThrownBy(() -> backupService.backup(inputStream, REPORT, URI)) .isInstanceOf(BackupServiceException.class) .hasMessageContaining(description); willThrow(ContentAddressableStorageServerException.class).given(workspaceClient).putObject(any(), any(), any()); assertThatThrownBy(() -> backupService.backup(inputStream, REPORT, URI)) .isInstanceOf(BackupServiceException.class) .hasMessageContaining(description); }
public StoredInfoResult backup(InputStream stream, DataCategory storageCollectionType, String uri) throws BackupServiceException { return backup(stream, storageCollectionType, uri, VitamConfiguration.getDefaultStrategy()); }
BackupService { public StoredInfoResult backup(InputStream stream, DataCategory storageCollectionType, String uri) throws BackupServiceException { return backup(stream, storageCollectionType, uri, VitamConfiguration.getDefaultStrategy()); } }
BackupService { public StoredInfoResult backup(InputStream stream, DataCategory storageCollectionType, String uri) throws BackupServiceException { return backup(stream, storageCollectionType, uri, VitamConfiguration.getDefaultStrategy()); } BackupService(); @VisibleForTesting  BackupService(
        WorkspaceClientFactory workspaceClientFactory,
        StorageClientFactory storageClientFactory); }
BackupService { public StoredInfoResult backup(InputStream stream, DataCategory storageCollectionType, String uri) throws BackupServiceException { return backup(stream, storageCollectionType, uri, VitamConfiguration.getDefaultStrategy()); } BackupService(); @VisibleForTesting  BackupService(
        WorkspaceClientFactory workspaceClientFactory,
        StorageClientFactory storageClientFactory); StoredInfoResult backupFromWorkspace(String workspaceUri, DataCategory storageCollectionType,
        String objectName); StoredInfoResult backup(InputStream stream, DataCategory storageCollectionType, String uri); StoredInfoResult backup(InputStream stream, DataCategory storageCollectionType, String uri,
        String strategyId); StoredInfoResult storeIntoOffers(String workspaceContainer, String workspaceUri,
        DataCategory storageCollectionType, String objectName,
        String strategyId); }
BackupService { public StoredInfoResult backup(InputStream stream, DataCategory storageCollectionType, String uri) throws BackupServiceException { return backup(stream, storageCollectionType, uri, VitamConfiguration.getDefaultStrategy()); } BackupService(); @VisibleForTesting  BackupService(
        WorkspaceClientFactory workspaceClientFactory,
        StorageClientFactory storageClientFactory); StoredInfoResult backupFromWorkspace(String workspaceUri, DataCategory storageCollectionType,
        String objectName); StoredInfoResult backup(InputStream stream, DataCategory storageCollectionType, String uri); StoredInfoResult backup(InputStream stream, DataCategory storageCollectionType, String uri,
        String strategyId); StoredInfoResult storeIntoOffers(String workspaceContainer, String workspaceUri,
        DataCategory storageCollectionType, String objectName,
        String strategyId);  }