### Question:
DatasetService extends AbstractService { public FutureResult<Void> loadDatasets(final Project project, DatasetManifest... datasets) { return loadDatasets(project, asList(datasets)); } DatasetService(final RestTemplate restTemplate, final DataStoreService dataStoreService,
                          final GoodDataSettings settings); DatasetManifest getDatasetManifest(Project project, String datasetId); FutureResult<Void> loadDataset(final Project project, final DatasetManifest manifest,
                                          final InputStream dataset); FutureResult<Void> loadDataset(Project project, String datasetId, InputStream dataset); FutureResult<Void> loadDatasets(final Project project, DatasetManifest... datasets); FutureResult<Void> loadDatasets(final Project project, final Collection<DatasetManifest> datasets); Collection<Link> listDatasetLinks(final Project project); FutureResult<Void> optimizeSliHash(final Project project); FutureResult<Void> updateProjectData(final Project project, final String maqlDml); Collection<Upload> listUploadsForDataset(Project project, String datasetId); Upload getLastUploadForDataset(Project project, String datasetId); UploadStatistics getUploadStatistics(Project project); static final UriTemplate UPLOADS_INFO_TEMPLATE; }### Answer:
@Test(expectedExceptions = DatasetException.class) public void testLoadDatasetWhenUploadFails() { doThrow(DataStoreException.class).when(dataStoreService).upload(anyString(), eq(stream)); when(manifest.getFile()).thenReturn(""); when(manifest.getSource()).thenReturn(stream); when(manifest.getDataSet()).thenReturn(DATASET_ID); service.loadDatasets(project, manifest); }