@Test(expectedExceptions = GoodDataException.class) public void testGetProcessByUriClientError() { when(restTemplate.getForObject(PROCESS_URI, DataloadProcess.class)).thenThrow(new RestClientException("")); processService.getProcessByUri(PROCESS_URI); }
public DataloadProcess getProcessByUri(String uri) { notEmpty(uri, "uri"); try { return restTemplate.getForObject(uri, DataloadProcess.class); } catch (GoodDataRestException e) { if (HttpStatus.NOT_FOUND.value() == e.getStatusCode()) { throw new ProcessNotFoundException(uri, e); } else { throw e; } } catch (RestClientException e) { throw new GoodDataException("Unable to get process " + uri, e); } }
ProcessService extends AbstractService { public DataloadProcess getProcessByUri(String uri) { notEmpty(uri, "uri"); try { return restTemplate.getForObject(uri, DataloadProcess.class); } catch (GoodDataRestException e) { if (HttpStatus.NOT_FOUND.value() == e.getStatusCode()) { throw new ProcessNotFoundException(uri, e); } else { throw e; } } catch (RestClientException e) { throw new GoodDataException("Unable to get process " + uri, e); } } }
ProcessService extends AbstractService { public DataloadProcess getProcessByUri(String uri) { notEmpty(uri, "uri"); try { return restTemplate.getForObject(uri, DataloadProcess.class); } catch (GoodDataRestException e) { if (HttpStatus.NOT_FOUND.value() == e.getStatusCode()) { throw new ProcessNotFoundException(uri, e); } else { throw e; } } catch (RestClientException e) { throw new GoodDataException("Unable to get process " + uri, e); } } ProcessService(final RestTemplate restTemplate, final AccountService accountService,
                          final DataStoreService dataStoreService, final GoodDataSettings settings); }
ProcessService extends AbstractService { public DataloadProcess getProcessByUri(String uri) { notEmpty(uri, "uri"); try { return restTemplate.getForObject(uri, DataloadProcess.class); } catch (GoodDataRestException e) { if (HttpStatus.NOT_FOUND.value() == e.getStatusCode()) { throw new ProcessNotFoundException(uri, e); } else { throw e; } } catch (RestClientException e) { throw new GoodDataException("Unable to get process " + uri, e); } } ProcessService(final RestTemplate restTemplate, final AccountService accountService,
                          final DataStoreService dataStoreService, final GoodDataSettings settings); DataloadProcess createProcess(Project project, DataloadProcess process, File processData); DataloadProcess createProcess(Project project, DataloadProcess process); FutureResult<DataloadProcess> createProcessFromAppstore(Project project, DataloadProcess process); DataloadProcess updateProcess(DataloadProcess process, File processData); FutureResult<DataloadProcess> updateProcessFromAppstore(DataloadProcess process); DataloadProcess getProcessByUri(String uri); DataloadProcess getProcessById(Project project, String id); Collection<DataloadProcess> listProcesses(Project project); Collection<DataloadProcess> listUserProcesses(); void removeProcess(DataloadProcess process); void getProcessSource(DataloadProcess process, OutputStream outputStream); void getExecutionLog(ProcessExecutionDetail executionDetail, OutputStream outputStream); FutureResult<ProcessExecutionDetail> executeProcess(ProcessExecution execution); Schedule createSchedule(Project project, Schedule schedule); Schedule updateSchedule(Schedule schedule); Schedule getScheduleByUri(String uri); Schedule getScheduleById(Project project, String id); PageBrowser<Schedule> listSchedules(final Project project); PageBrowser<Schedule> listSchedules(final Project project,
                                                final PageRequest startPage); void removeSchedule(final Schedule schedule); FutureResult<ScheduleExecution> executeSchedule(final Schedule schedule); }
ProcessService extends AbstractService { public DataloadProcess getProcessByUri(String uri) { notEmpty(uri, "uri"); try { return restTemplate.getForObject(uri, DataloadProcess.class); } catch (GoodDataRestException e) { if (HttpStatus.NOT_FOUND.value() == e.getStatusCode()) { throw new ProcessNotFoundException(uri, e); } else { throw e; } } catch (RestClientException e) { throw new GoodDataException("Unable to get process " + uri, e); } } ProcessService(final RestTemplate restTemplate, final AccountService accountService,
                          final DataStoreService dataStoreService, final GoodDataSettings settings); DataloadProcess createProcess(Project project, DataloadProcess process, File processData); DataloadProcess createProcess(Project project, DataloadProcess process); FutureResult<DataloadProcess> createProcessFromAppstore(Project project, DataloadProcess process); DataloadProcess updateProcess(DataloadProcess process, File processData); FutureResult<DataloadProcess> updateProcessFromAppstore(DataloadProcess process); DataloadProcess getProcessByUri(String uri); DataloadProcess getProcessById(Project project, String id); Collection<DataloadProcess> listProcesses(Project project); Collection<DataloadProcess> listUserProcesses(); void removeProcess(DataloadProcess process); void getProcessSource(DataloadProcess process, OutputStream outputStream); void getExecutionLog(ProcessExecutionDetail executionDetail, OutputStream outputStream); FutureResult<ProcessExecutionDetail> executeProcess(ProcessExecution execution); Schedule createSchedule(Project project, Schedule schedule); Schedule updateSchedule(Schedule schedule); Schedule getScheduleByUri(String uri); Schedule getScheduleById(Project project, String id); PageBrowser<Schedule> listSchedules(final Project project); PageBrowser<Schedule> listSchedules(final Project project,
                                                final PageRequest startPage); void removeSchedule(final Schedule schedule); FutureResult<ScheduleExecution> executeSchedule(final Schedule schedule); static final UriTemplate SCHEDULE_TEMPLATE; static final UriTemplate PROCESS_TEMPLATE; static final UriTemplate SCHEDULES_TEMPLATE; static final UriTemplate PROCESSES_TEMPLATE; static final UriTemplate USER_PROCESSES_TEMPLATE; }