@Test public void should_create_report_option() throws Exception { reportOptionsUseCase.createReportOption(REPORT_URI, OPTION_LABEL, REPORT_PARAMETERS, true); verify(mReportOptionMapper).transform(any(ReportOptionEntity.class)); verify(mReportOptionRestApi).createReportOption(REPORT_URI, OPTION_LABEL, REPORT_PARAMETERS, true); }
public ReportOption createReportOption(String reportUri, String optionLabel, List<ReportParameter> parameters, boolean overwrite) throws ServiceException { try { ReportOptionEntity entity = mReportOptionRestApi.createReportOption(reportUri, optionLabel, parameters, overwrite); return mReportOptionMapper.transform(entity); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catch (IOException e) { throw mExceptionMapper.transform(e); } }
ReportOptionsUseCase { public ReportOption createReportOption(String reportUri, String optionLabel, List<ReportParameter> parameters, boolean overwrite) throws ServiceException { try { ReportOptionEntity entity = mReportOptionRestApi.createReportOption(reportUri, optionLabel, parameters, overwrite); return mReportOptionMapper.transform(entity); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catch (IOException e) { throw mExceptionMapper.transform(e); } } }
ReportOptionsUseCase { public ReportOption createReportOption(String reportUri, String optionLabel, List<ReportParameter> parameters, boolean overwrite) throws ServiceException { try { ReportOptionEntity entity = mReportOptionRestApi.createReportOption(reportUri, optionLabel, parameters, overwrite); return mReportOptionMapper.transform(entity); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catch (IOException e) { throw mExceptionMapper.transform(e); } } ReportOptionsUseCase(ServiceExceptionMapper exceptionMapper, ReportOptionRestApi reportOptionRestApi, ReportOptionMapper reportOptionMapper); }
ReportOptionsUseCase { public ReportOption createReportOption(String reportUri, String optionLabel, List<ReportParameter> parameters, boolean overwrite) throws ServiceException { try { ReportOptionEntity entity = mReportOptionRestApi.createReportOption(reportUri, optionLabel, parameters, overwrite); return mReportOptionMapper.transform(entity); } 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 ReportOption createReportOption(String reportUri, String optionLabel, List<ReportParameter> parameters, boolean overwrite) throws ServiceException { try { ReportOptionEntity entity = mReportOptionRestApi.createReportOption(reportUri, optionLabel, parameters, overwrite); return mReportOptionMapper.transform(entity); } 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);  }