### Question:
RepositoryUseCase { public DashboardComponentCollection requestDashboardComponents(String dashboardUri) throws ServiceException { try { return mRestApi.requestDashboardComponents(dashboardUri); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catch (IOException e) { throw mExceptionMapper.transform(e); } } RepositoryUseCase(ServiceExceptionMapper exceptionMapper, RepositoryRestApi restApi); DashboardComponentCollection requestDashboardComponents(String dashboardUri);  }### Answer:
@Test public void list_dashboard_components() throws Exception { useCase.requestDashboardComponents(DASHBOARD_URI); verify(mRepositoryRestApi).requestDashboardComponents(DASHBOARD_URI); }
@Test public void list_dashboard_components_adapts_io_exception() throws Exception { when(mRepositoryRestApi.requestDashboardComponents(anyString())).thenThrow(mIOException); try { useCase.requestDashboardComponents(DASHBOARD_URI); fail("Should adapt IO exception"); } catch (ServiceException ex) { verify(mExceptionMapper).transform(mIOException); } }
@Test public void list_dashboard_components_adapts_http_exception() throws Exception { when(mRepositoryRestApi.requestDashboardComponents(anyString())).thenThrow(mHttpException); try { useCase.requestDashboardComponents(DASHBOARD_URI); fail("Should adapt HTTP exception"); } catch (ServiceException ex) { verify(mExceptionMapper).transform(mHttpException); } }