@Test public void should_fail_when_storing_from_workSpace() throws Exception { final String message = "Unable to store file from workSpace"; willThrow(StorageAlreadyExistsClientException.class).given(storageClient) .storeFileFromWorkspace(any(), any(), any(), any()); assertThatThrownBy(() -> backupService.backup(inputStream, REPORT, URI)) .isInstanceOf(BackupServiceException.class) .hasMessageContaining(message); willThrow(StorageNotFoundClientException.class).given(storageClient) .storeFileFromWorkspace(any(), any(), any(), any()); assertThatThrownBy(() -> backupService.backup(inputStream, REPORT, URI)) .isInstanceOf(BackupServiceException.class) .hasMessageContaining(message); willThrow(StorageServerClientException.class).given(storageClient) .storeFileFromWorkspace(any(), any(), any(), any()); assertThatThrownBy(() -> backupService.backup(inputStream, REPORT, URI)) .isInstanceOf(BackupServiceException.class) .hasMessageContaining(message); }
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);  }