@Test public void create_job_adapts_io_exception() throws Exception { when(mScheduleRestApi.createJob(any(JobFormEntity.class))).thenThrow(mIOException); try { useCase.createJob(mJobForm); fail("Should adapt IO exception"); } catch (ServiceException ex) { verify(mExceptionMapper).transform(mIOException); } }
public JobData createJob(JobForm form) throws ServiceException { return alterJob(form, null); }
ReportScheduleUseCase { public JobData createJob(JobForm form) throws ServiceException { return alterJob(form, null); } }
ReportScheduleUseCase { public JobData createJob(JobForm form) throws ServiceException { return alterJob(form, null); } ReportScheduleUseCase(ServiceExceptionMapper exceptionMapper,
                          ReportScheduleRestApi scheduleRestApi,
                          InfoCacheManager cacheManager,
                          JobSearchCriteriaMapper searchCriteriaMapper,
                          JobDataMapper jobDataMapper,
                          JobFormMapper jobFormMapper,
                          JobUnitMapper jobUnitMapper
    ); }
ReportScheduleUseCase { public JobData createJob(JobForm form) throws ServiceException { return alterJob(form, null); } 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 JobData createJob(JobForm form) throws ServiceException { return alterJob(form, null); } 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);  }