### Question:
DatasetService extends AbstractService { UploadsInfo.DataSet getDataSetInfo(Project project, String datasetId) { notNull(project, "project"); notNull(project.getId(), "project.id"); notEmpty(datasetId, "datasetId"); final URI uploadsInfoUri = UPLOADS_INFO_TEMPLATE.expand(project.getId()); try { final UploadsInfo uploadsInfo = restTemplate.getForObject(uploadsInfoUri, UploadsInfo.class); if (uploadsInfo == null) { throw new GoodDataException("Empty response from '" + uploadsInfoUri.toString() + "'."); } return uploadsInfo.getDataSet(datasetId); } catch (RestClientException e) { throw new GoodDataException("Unable to get '" + uploadsInfoUri.toString() + "'.", e); } } 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 = GoodDataException.class) public void testGetDataSetInfoRestClientError() { when(restTemplate.getForObject(UploadsInfo.URI, UploadsInfo.class, PROJECT_ID)) .thenThrow(new RestClientException("")); service.getDataSetInfo(project, "dataset.id"); }
@Test(expectedExceptions = GoodDataException.class) public void testGetDataSetInfoEmptyResponse() { when(restTemplate.getForObject(UploadsInfo.URI, UploadsInfo.class, PROJECT_ID)).thenReturn(null); service.getDataSetInfo(project, "dataset.id"); }