@Test public void should_store_file_strategy() throws Exception { final String uri = URI; ArgumentCaptor<ObjectDescription> objectDescriptionArgumentCaptor = ArgumentCaptor.forClass(ObjectDescription.class); backupService.backup(inputStream, UNIT, uri,"other_strategy"); ArgumentCaptor<String> containerArgCaptor = ArgumentCaptor.forClass(String.class); verify(workspaceClient) .putObject(containerArgCaptor.capture(), eq(uri), eq(inputStream)); verify(storageClient) .storeFileFromWorkspace(eq("other_strategy"), eq(UNIT), eq(uri), objectDescriptionArgumentCaptor.capture()); ObjectDescription description = objectDescriptionArgumentCaptor.getValue(); assertThat(description.getWorkspaceContainerGUID()).isEqualTo(containerArgCaptor.getValue()); assertThat(description.getWorkspaceObjectURI()).isEqualTo(uri); verify(workspaceClient).deleteContainer(containerArgCaptor.getValue(), true); }
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);  }