@Test public void should_list_report_options() throws Exception { reportOptionsUseCase.requestReportOptionsList(REPORT_URI); verify(mReportOptionMapper).transform(anySetOf(ReportOptionEntity.class)); verify(mReportOptionRestApi).requestReportOptionsList(REPORT_URI); }
public Set<ReportOption> requestReportOptionsList(String reportUnitUri) throws ServiceException { try { Set<ReportOptionEntity> entities = mReportOptionRestApi.requestReportOptionsList(reportUnitUri); return mReportOptionMapper.transform(entities); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catch (IOException e) { throw mExceptionMapper.transform(e); } }
ReportOptionsUseCase { public Set<ReportOption> requestReportOptionsList(String reportUnitUri) throws ServiceException { try { Set<ReportOptionEntity> entities = mReportOptionRestApi.requestReportOptionsList(reportUnitUri); return mReportOptionMapper.transform(entities); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catch (IOException e) { throw mExceptionMapper.transform(e); } } }
ReportOptionsUseCase { public Set<ReportOption> requestReportOptionsList(String reportUnitUri) throws ServiceException { try { Set<ReportOptionEntity> entities = mReportOptionRestApi.requestReportOptionsList(reportUnitUri); return mReportOptionMapper.transform(entities); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catch (IOException e) { throw mExceptionMapper.transform(e); } } ReportOptionsUseCase(ServiceExceptionMapper exceptionMapper, ReportOptionRestApi reportOptionRestApi, ReportOptionMapper reportOptionMapper); }
ReportOptionsUseCase { public Set<ReportOption> requestReportOptionsList(String reportUnitUri) throws ServiceException { try { Set<ReportOptionEntity> entities = mReportOptionRestApi.requestReportOptionsList(reportUnitUri); return mReportOptionMapper.transform(entities); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catch (IOException e) { throw mExceptionMapper.transform(e); } } ReportOptionsUseCase(ServiceExceptionMapper exceptionMapper, ReportOptionRestApi reportOptionRestApi, ReportOptionMapper reportOptionMapper); Set<ReportOption> requestReportOptionsList(String reportUnitUri); ReportOption createReportOption(String reportUri,
                                           String optionLabel,
                                           List<ReportParameter> parameters,
                                           boolean overwrite); void updateReportOption(String reportUri, String optionId, List<ReportParameter> parameters); void deleteReportOption(String reportUri, String optionId); }
ReportOptionsUseCase { public Set<ReportOption> requestReportOptionsList(String reportUnitUri) throws ServiceException { try { Set<ReportOptionEntity> entities = mReportOptionRestApi.requestReportOptionsList(reportUnitUri); return mReportOptionMapper.transform(entities); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catch (IOException e) { throw mExceptionMapper.transform(e); } } ReportOptionsUseCase(ServiceExceptionMapper exceptionMapper, ReportOptionRestApi reportOptionRestApi, ReportOptionMapper reportOptionMapper); Set<ReportOption> requestReportOptionsList(String reportUnitUri); ReportOption createReportOption(String reportUri,
                                           String optionLabel,
                                           List<ReportParameter> parameters,
                                           boolean overwrite); void updateReportOption(String reportUri, String optionId, List<ReportParameter> parameters); void deleteReportOption(String reportUri, String optionId);  }