@Test public void should_perform_read_job() throws Exception { when(mScheduleRestApi.requestJob(anyInt())).thenReturn(mJobFormEntity); JobForm expected = useCase.readJob(JOB_ID); assertThat(mJobForm, is(expected)); verify(mJobFormMapper).toDataForm(mJobFormEntity); verify(mScheduleRestApi).requestJob(JOB_ID); }
public JobForm readJob(int jobId) throws ServiceException { try { JobFormEntity entity = mScheduleRestApi.requestJob(jobId); return mJobFormMapper.toDataForm(entity); } catch (IOException e) { throw mExceptionMapper.transform(e); } catch (HttpException e) { throw mExceptionMapper.transform(e); } }
ReportScheduleUseCase { public JobForm readJob(int jobId) throws ServiceException { try { JobFormEntity entity = mScheduleRestApi.requestJob(jobId); return mJobFormMapper.toDataForm(entity); } catch (IOException e) { throw mExceptionMapper.transform(e); } catch (HttpException e) { throw mExceptionMapper.transform(e); } } }
ReportScheduleUseCase { public JobForm readJob(int jobId) throws ServiceException { try { JobFormEntity entity = mScheduleRestApi.requestJob(jobId); return mJobFormMapper.toDataForm(entity); } catch (IOException e) { throw mExceptionMapper.transform(e); } catch (HttpException e) { throw mExceptionMapper.transform(e); } } ReportScheduleUseCase(ServiceExceptionMapper exceptionMapper,
                          ReportScheduleRestApi scheduleRestApi,
                          InfoCacheManager cacheManager,
                          JobSearchCriteriaMapper searchCriteriaMapper,
                          JobDataMapper jobDataMapper,
                          JobFormMapper jobFormMapper,
                          JobUnitMapper jobUnitMapper
    ); }
ReportScheduleUseCase { public JobForm readJob(int jobId) throws ServiceException { try { JobFormEntity entity = mScheduleRestApi.requestJob(jobId); return mJobFormMapper.toDataForm(entity); } catch (IOException e) { throw mExceptionMapper.transform(e); } catch (HttpException e) { throw mExceptionMapper.transform(e); } } ReportScheduleUseCase(ServiceExceptionMapper exceptionMapper,
                          ReportScheduleRestApi scheduleRestApi,
                          InfoCacheManager cacheManager,
                          JobSearchCriteriaMapper searchCriteriaMapper,
                          JobDataMapper jobDataMapper,
                          JobFormMapper jobFormMapper,
                          JobUnitMapper jobUnitMapper
    ); List<JobUnit> searchJob(JobSearchCriteria criteria); JobData createJob(JobForm form); JobData updateJob(int id, JobForm form); Set<Integer> deleteJobs(Set<Integer> jobIds); JobForm readJob(int jobId); }
ReportScheduleUseCase { public JobForm readJob(int jobId) throws ServiceException { try { JobFormEntity entity = mScheduleRestApi.requestJob(jobId); return mJobFormMapper.toDataForm(entity); } catch (IOException e) { throw mExceptionMapper.transform(e); } catch (HttpException e) { throw mExceptionMapper.transform(e); } } ReportScheduleUseCase(ServiceExceptionMapper exceptionMapper,
                          ReportScheduleRestApi scheduleRestApi,
                          InfoCacheManager cacheManager,
                          JobSearchCriteriaMapper searchCriteriaMapper,
                          JobDataMapper jobDataMapper,
                          JobFormMapper jobFormMapper,
                          JobUnitMapper jobUnitMapper
    ); List<JobUnit> searchJob(JobSearchCriteria criteria); JobData createJob(JobForm form); JobData updateJob(int id, JobForm form); Set<Integer> deleteJobs(Set<Integer> jobIds); JobForm readJob(int jobId);  }