target stringlengths 20 113k | src_fm stringlengths 11 86.3k | src_fm_fc stringlengths 21 86.4k | src_fm_fc_co stringlengths 30 86.4k | src_fm_fc_ms stringlengths 42 86.8k | src_fm_fc_ms_ff stringlengths 43 86.8k |
|---|---|---|---|---|---|
@Test public void shouldReturnEmptyCollectionForZeroLimit() throws Exception { InternalCriteria userCriteria = new InternalCriteria.Builder().limit(0).offset(5).create(); RepositorySearchTask strategy = new RepositorySearchTaskV5_6Plus(userCriteria, mSearchUseCase); Collection<Resource> result = strategy.nextLookup(); ... | @NotNull @Override public List<Resource> nextLookup() throws ServiceException { if (mEndReached || mInitialCriteria.getLimit() == 0){ return EMPTY_RESPONSE; } if (mInternalOffset == UNDEFINED) { defineInternalOffset(); } return Collections.unmodifiableList(performLookup()); } | RepositorySearchTaskV5_6Plus extends RepositorySearchTask { @NotNull @Override public List<Resource> nextLookup() throws ServiceException { if (mEndReached || mInitialCriteria.getLimit() == 0){ return EMPTY_RESPONSE; } if (mInternalOffset == UNDEFINED) { defineInternalOffset(); } return Collections.unmodifiableList(per... | RepositorySearchTaskV5_6Plus extends RepositorySearchTask { @NotNull @Override public List<Resource> nextLookup() throws ServiceException { if (mEndReached || mInitialCriteria.getLimit() == 0){ return EMPTY_RESPONSE; } if (mInternalOffset == UNDEFINED) { defineInternalOffset(); } return Collections.unmodifiableList(per... | RepositorySearchTaskV5_6Plus extends RepositorySearchTask { @NotNull @Override public List<Resource> nextLookup() throws ServiceException { if (mEndReached || mInitialCriteria.getLimit() == 0){ return EMPTY_RESPONSE; } if (mInternalOffset == UNDEFINED) { defineInternalOffset(); } return Collections.unmodifiableList(per... | RepositorySearchTaskV5_6Plus extends RepositorySearchTask { @NotNull @Override public List<Resource> nextLookup() throws ServiceException { if (mEndReached || mInitialCriteria.getLimit() == 0){ return EMPTY_RESPONSE; } if (mInternalOffset == UNDEFINED) { defineInternalOffset(); } return Collections.unmodifiableList(per... |
@Test public void shouldReturnEmptyCollectionForZeroLimit() throws Exception { InternalCriteria userCriteria = new InternalCriteria.Builder().limit(0).offset(5).create(); RepositorySearchTask strategy = new RepositorySearchTaskV5_5(userCriteria, mSearchUseCase); List<Resource> result = strategy.nextLookup(); assertThat... | @NotNull @Override public List<Resource> nextLookup() throws ServiceException { int limit = mInitialCriteria.getLimit(); int offset = mInitialCriteria.getOffset(); if (mEndReached || limit == 0) { return EMPTY_RESPONSE; } calculateDisposition(offset); return Collections.unmodifiableList(internalSearch(limit)); } | RepositorySearchTaskV5_5 extends RepositorySearchTask { @NotNull @Override public List<Resource> nextLookup() throws ServiceException { int limit = mInitialCriteria.getLimit(); int offset = mInitialCriteria.getOffset(); if (mEndReached || limit == 0) { return EMPTY_RESPONSE; } calculateDisposition(offset); return Colle... | RepositorySearchTaskV5_5 extends RepositorySearchTask { @NotNull @Override public List<Resource> nextLookup() throws ServiceException { int limit = mInitialCriteria.getLimit(); int offset = mInitialCriteria.getOffset(); if (mEndReached || limit == 0) { return EMPTY_RESPONSE; } calculateDisposition(offset); return Colle... | RepositorySearchTaskV5_5 extends RepositorySearchTask { @NotNull @Override public List<Resource> nextLookup() throws ServiceException { int limit = mInitialCriteria.getLimit(); int offset = mInitialCriteria.getOffset(); if (mEndReached || limit == 0) { return EMPTY_RESPONSE; } calculateDisposition(offset); return Colle... | RepositorySearchTaskV5_5 extends RepositorySearchTask { @NotNull @Override public List<Resource> nextLookup() throws ServiceException { int limit = mInitialCriteria.getLimit(); int offset = mInitialCriteria.getOffset(); if (mEndReached || limit == 0) { return EMPTY_RESPONSE; } calculateDisposition(offset); return Colle... |
@Test public void shouldProvideAndAdaptSearchResult() throws Exception { when(mResult.getNextOffset()).thenReturn(100); when(mRepositoryRestApi.searchResources(anyMapOf(String.class, Object.class))).thenReturn(mResult); List<Resource> resources = new ArrayList<Resource>(); when(mDataMapper.toResources(anyCollectionOf(R... | @NotNull public SearchResult performSearch(@NotNull final InternalCriteria internalCriteria) throws ServiceException { final SimpleDateFormat dateTimeFormat = mInfoCacheManager.getInfo().getDatetimeFormatPattern(); Call<SearchResult> call = new Call<SearchResult>() { @Override public SearchResult perform() throws IOExc... | SearchUseCase { @NotNull public SearchResult performSearch(@NotNull final InternalCriteria internalCriteria) throws ServiceException { final SimpleDateFormat dateTimeFormat = mInfoCacheManager.getInfo().getDatetimeFormatPattern(); Call<SearchResult> call = new Call<SearchResult>() { @Override public SearchResult perfor... | SearchUseCase { @NotNull public SearchResult performSearch(@NotNull final InternalCriteria internalCriteria) throws ServiceException { final SimpleDateFormat dateTimeFormat = mInfoCacheManager.getInfo().getDatetimeFormatPattern(); Call<SearchResult> call = new Call<SearchResult>() { @Override public SearchResult perfor... | SearchUseCase { @NotNull public SearchResult performSearch(@NotNull final InternalCriteria internalCriteria) throws ServiceException { final SimpleDateFormat dateTimeFormat = mInfoCacheManager.getInfo().getDatetimeFormatPattern(); Call<SearchResult> call = new Call<SearchResult>() { @Override public SearchResult perfor... | SearchUseCase { @NotNull public SearchResult performSearch(@NotNull final InternalCriteria internalCriteria) throws ServiceException { final SimpleDateFormat dateTimeFormat = mInfoCacheManager.getInfo().getDatetimeFormatPattern(); Call<SearchResult> call = new Call<SearchResult>() { @Override public SearchResult perfor... |
@Test public void testNextLookup() throws Exception { searchTask.nextLookup(); verify(mSearchTaskFactory).create(); searchTask.nextLookup(); verifyNoMoreInteractions(mSearchTaskFactory); } | @NotNull @Override public List<Resource> nextLookup() throws ServiceException { if (mDelegate == null) { mDelegate = mSearchTaskFactory.create(); } return mDelegate.nextLookup(); } | RepositorySearchTaskProxy extends RepositorySearchTask { @NotNull @Override public List<Resource> nextLookup() throws ServiceException { if (mDelegate == null) { mDelegate = mSearchTaskFactory.create(); } return mDelegate.nextLookup(); } } | RepositorySearchTaskProxy extends RepositorySearchTask { @NotNull @Override public List<Resource> nextLookup() throws ServiceException { if (mDelegate == null) { mDelegate = mSearchTaskFactory.create(); } return mDelegate.nextLookup(); } RepositorySearchTaskProxy(SearchTaskFactory searchTaskFactory); } | RepositorySearchTaskProxy extends RepositorySearchTask { @NotNull @Override public List<Resource> nextLookup() throws ServiceException { if (mDelegate == null) { mDelegate = mSearchTaskFactory.create(); } return mDelegate.nextLookup(); } RepositorySearchTaskProxy(SearchTaskFactory searchTaskFactory); @NotNull @Override... | RepositorySearchTaskProxy extends RepositorySearchTask { @NotNull @Override public List<Resource> nextLookup() throws ServiceException { if (mDelegate == null) { mDelegate = mSearchTaskFactory.create(); } return mDelegate.nextLookup(); } RepositorySearchTaskProxy(SearchTaskFactory searchTaskFactory); @NotNull @Override... |
@Test public void testHasNext() throws Exception { when(mDelegate.hasNext()).thenReturn(true); assertThat("Has next returns false by default", searchTask.hasNext(), is(false)); searchTask.nextLookup(); assertThat("Has next returns true from delegate", searchTask.hasNext(), is(true)); } | @Override public boolean hasNext() { return mDelegate != null && mDelegate.hasNext(); } | RepositorySearchTaskProxy extends RepositorySearchTask { @Override public boolean hasNext() { return mDelegate != null && mDelegate.hasNext(); } } | RepositorySearchTaskProxy extends RepositorySearchTask { @Override public boolean hasNext() { return mDelegate != null && mDelegate.hasNext(); } RepositorySearchTaskProxy(SearchTaskFactory searchTaskFactory); } | RepositorySearchTaskProxy extends RepositorySearchTask { @Override public boolean hasNext() { return mDelegate != null && mDelegate.hasNext(); } RepositorySearchTaskProxy(SearchTaskFactory searchTaskFactory); @NotNull @Override List<Resource> nextLookup(); @Override boolean hasNext(); } | RepositorySearchTaskProxy extends RepositorySearchTask { @Override public boolean hasNext() { return mDelegate != null && mDelegate.hasNext(); } RepositorySearchTaskProxy(SearchTaskFactory searchTaskFactory); @NotNull @Override List<Resource> nextLookup(); @Override boolean hasNext(); } |
@Test public void should_map_format() { ReportExportOptions criteria = ReportExportOptions.builder() .withFormat(ReportFormat.PDF) .build(); ExecutionRequestOptions options = mapper.transform(criteria); assertThat("Failed to map 'format' option", options.getOutputFormat(), is("pdf")); } | public ExecutionRequestOptions transform(ReportExportOptions options) { ExecutionRequestOptions resultOptions = ExecutionRequestOptions.create(); ReportFormat format = options.getFormat(); resultOptions.withOutputFormat(format.toString().toLowerCase()); PageRange pageRange = options.getPageRange(); if (pageRange != nul... | ExportOptionsMapper { public ExecutionRequestOptions transform(ReportExportOptions options) { ExecutionRequestOptions resultOptions = ExecutionRequestOptions.create(); ReportFormat format = options.getFormat(); resultOptions.withOutputFormat(format.toString().toLowerCase()); PageRange pageRange = options.getPageRange()... | ExportOptionsMapper { public ExecutionRequestOptions transform(ReportExportOptions options) { ExecutionRequestOptions resultOptions = ExecutionRequestOptions.create(); ReportFormat format = options.getFormat(); resultOptions.withOutputFormat(format.toString().toLowerCase()); PageRange pageRange = options.getPageRange()... | ExportOptionsMapper { public ExecutionRequestOptions transform(ReportExportOptions options) { ExecutionRequestOptions resultOptions = ExecutionRequestOptions.create(); ReportFormat format = options.getFormat(); resultOptions.withOutputFormat(format.toString().toLowerCase()); PageRange pageRange = options.getPageRange()... | ExportOptionsMapper { public ExecutionRequestOptions transform(ReportExportOptions options) { ExecutionRequestOptions resultOptions = ExecutionRequestOptions.create(); ReportFormat format = options.getFormat(); resultOptions.withOutputFormat(format.toString().toLowerCase()); PageRange pageRange = options.getPageRange()... |
@Test public void should_map_pages() { PageRange range = PageRange.parse("1-10"); ReportExportOptions criteria = ReportExportOptions.builder() .withFormat(ReportFormat.PDF) .withPageRange(range) .build(); ExecutionRequestOptions options = mapper.transform(criteria); assertThat("Failed to map 'pages' option", options.ge... | public ExecutionRequestOptions transform(ReportExportOptions options) { ExecutionRequestOptions resultOptions = ExecutionRequestOptions.create(); ReportFormat format = options.getFormat(); resultOptions.withOutputFormat(format.toString().toLowerCase()); PageRange pageRange = options.getPageRange(); if (pageRange != nul... | ExportOptionsMapper { public ExecutionRequestOptions transform(ReportExportOptions options) { ExecutionRequestOptions resultOptions = ExecutionRequestOptions.create(); ReportFormat format = options.getFormat(); resultOptions.withOutputFormat(format.toString().toLowerCase()); PageRange pageRange = options.getPageRange()... | ExportOptionsMapper { public ExecutionRequestOptions transform(ReportExportOptions options) { ExecutionRequestOptions resultOptions = ExecutionRequestOptions.create(); ReportFormat format = options.getFormat(); resultOptions.withOutputFormat(format.toString().toLowerCase()); PageRange pageRange = options.getPageRange()... | ExportOptionsMapper { public ExecutionRequestOptions transform(ReportExportOptions options) { ExecutionRequestOptions resultOptions = ExecutionRequestOptions.create(); ReportFormat format = options.getFormat(); resultOptions.withOutputFormat(format.toString().toLowerCase()); PageRange pageRange = options.getPageRange()... | ExportOptionsMapper { public ExecutionRequestOptions transform(ReportExportOptions options) { ExecutionRequestOptions resultOptions = ExecutionRequestOptions.create(); ReportFormat format = options.getFormat(); resultOptions.withOutputFormat(format.toString().toLowerCase()); PageRange pageRange = options.getPageRange()... |
@Test public void requestExportAttachmentShouldThrowRestErrorOn500() throws Exception { mExpectedException.expect(HttpException.class); mWebMockRule.enqueue(MockResponseFactory.create500()); restApiUnderTest.requestExportAttachment("any_id", "any_id", "any_id"); } | @NotNull public OutputResource requestExportAttachment(@NotNull String executionId, @NotNull String exportId, @NotNull String attachmentId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(exportId, "Export id should not be null"); Utils.checkNot... | ReportExportRestApi { @NotNull public OutputResource requestExportAttachment(@NotNull String executionId, @NotNull String exportId, @NotNull String attachmentId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(exportId, "Export id should not be ... | ReportExportRestApi { @NotNull public OutputResource requestExportAttachment(@NotNull String executionId, @NotNull String exportId, @NotNull String attachmentId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(exportId, "Export id should not be ... | ReportExportRestApi { @NotNull public OutputResource requestExportAttachment(@NotNull String executionId, @NotNull String exportId, @NotNull String attachmentId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(exportId, "Export id should not be ... | ReportExportRestApi { @NotNull public OutputResource requestExportAttachment(@NotNull String executionId, @NotNull String exportId, @NotNull String attachmentId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(exportId, "Export id should not be ... |
@Test public void should_include_ignore_pagination_flag() throws Exception { ReportExportOptions criteria = ReportExportOptions.builder() .withFormat(ReportFormat.PDF) .withIgnorePagination(true) .build(); ExecutionRequestOptions options = mapper.transform(criteria); assertThat("Failed to map 'ignorePagination' option"... | public ExecutionRequestOptions transform(ReportExportOptions options) { ExecutionRequestOptions resultOptions = ExecutionRequestOptions.create(); ReportFormat format = options.getFormat(); resultOptions.withOutputFormat(format.toString().toLowerCase()); PageRange pageRange = options.getPageRange(); if (pageRange != nul... | ExportOptionsMapper { public ExecutionRequestOptions transform(ReportExportOptions options) { ExecutionRequestOptions resultOptions = ExecutionRequestOptions.create(); ReportFormat format = options.getFormat(); resultOptions.withOutputFormat(format.toString().toLowerCase()); PageRange pageRange = options.getPageRange()... | ExportOptionsMapper { public ExecutionRequestOptions transform(ReportExportOptions options) { ExecutionRequestOptions resultOptions = ExecutionRequestOptions.create(); ReportFormat format = options.getFormat(); resultOptions.withOutputFormat(format.toString().toLowerCase()); PageRange pageRange = options.getPageRange()... | ExportOptionsMapper { public ExecutionRequestOptions transform(ReportExportOptions options) { ExecutionRequestOptions resultOptions = ExecutionRequestOptions.create(); ReportFormat format = options.getFormat(); resultOptions.withOutputFormat(format.toString().toLowerCase()); PageRange pageRange = options.getPageRange()... | ExportOptionsMapper { public ExecutionRequestOptions transform(ReportExportOptions options) { ExecutionRequestOptions resultOptions = ExecutionRequestOptions.create(); ReportFormat format = options.getFormat(); resultOptions.withOutputFormat(format.toString().toLowerCase()); PageRange pageRange = options.getPageRange()... |
@Test public void should_map_anchor() { ReportExportOptions criteria = ReportExportOptions.builder() .withFormat(ReportFormat.PDF) .withAnchor("anchor") .build(); ExecutionRequestOptions options = mapper.transform(criteria); assertThat("Failed to map 'anchor' option", options.getAnchor(), is("anchor")); } | public ExecutionRequestOptions transform(ReportExportOptions options) { ExecutionRequestOptions resultOptions = ExecutionRequestOptions.create(); ReportFormat format = options.getFormat(); resultOptions.withOutputFormat(format.toString().toLowerCase()); PageRange pageRange = options.getPageRange(); if (pageRange != nul... | ExportOptionsMapper { public ExecutionRequestOptions transform(ReportExportOptions options) { ExecutionRequestOptions resultOptions = ExecutionRequestOptions.create(); ReportFormat format = options.getFormat(); resultOptions.withOutputFormat(format.toString().toLowerCase()); PageRange pageRange = options.getPageRange()... | ExportOptionsMapper { public ExecutionRequestOptions transform(ReportExportOptions options) { ExecutionRequestOptions resultOptions = ExecutionRequestOptions.create(); ReportFormat format = options.getFormat(); resultOptions.withOutputFormat(format.toString().toLowerCase()); PageRange pageRange = options.getPageRange()... | ExportOptionsMapper { public ExecutionRequestOptions transform(ReportExportOptions options) { ExecutionRequestOptions resultOptions = ExecutionRequestOptions.create(); ReportFormat format = options.getFormat(); resultOptions.withOutputFormat(format.toString().toLowerCase()); PageRange pageRange = options.getPageRange()... | ExportOptionsMapper { public ExecutionRequestOptions transform(ReportExportOptions options) { ExecutionRequestOptions resultOptions = ExecutionRequestOptions.create(); ReportFormat format = options.getFormat(); resultOptions.withOutputFormat(format.toString().toLowerCase()); PageRange pageRange = options.getPageRange()... |
@Test public void should_map_attachmentPrefix() { ReportExportOptions criteria = ReportExportOptions.builder() .withFormat(ReportFormat.PDF) .withAttachmentPrefix("./") .build(); ExecutionRequestOptions options = mapper.transform(criteria); assertThat("Failed to map 'attachmentPrefix' option", options.getAttachmentsPre... | public ExecutionRequestOptions transform(ReportExportOptions options) { ExecutionRequestOptions resultOptions = ExecutionRequestOptions.create(); ReportFormat format = options.getFormat(); resultOptions.withOutputFormat(format.toString().toLowerCase()); PageRange pageRange = options.getPageRange(); if (pageRange != nul... | ExportOptionsMapper { public ExecutionRequestOptions transform(ReportExportOptions options) { ExecutionRequestOptions resultOptions = ExecutionRequestOptions.create(); ReportFormat format = options.getFormat(); resultOptions.withOutputFormat(format.toString().toLowerCase()); PageRange pageRange = options.getPageRange()... | ExportOptionsMapper { public ExecutionRequestOptions transform(ReportExportOptions options) { ExecutionRequestOptions resultOptions = ExecutionRequestOptions.create(); ReportFormat format = options.getFormat(); resultOptions.withOutputFormat(format.toString().toLowerCase()); PageRange pageRange = options.getPageRange()... | ExportOptionsMapper { public ExecutionRequestOptions transform(ReportExportOptions options) { ExecutionRequestOptions resultOptions = ExecutionRequestOptions.create(); ReportFormat format = options.getFormat(); resultOptions.withOutputFormat(format.toString().toLowerCase()); PageRange pageRange = options.getPageRange()... | ExportOptionsMapper { public ExecutionRequestOptions transform(ReportExportOptions options) { ExecutionRequestOptions resultOptions = ExecutionRequestOptions.create(); ReportFormat format = options.getFormat(); resultOptions.withOutputFormat(format.toString().toLowerCase()); PageRange pageRange = options.getPageRange()... |
@Test public void should_map_allowInlineScripts() { ReportExportOptions criteria = ReportExportOptions.builder() .withFormat(ReportFormat.PDF) .withAllowInlineScripts(true) .build(); ExecutionRequestOptions options = mapper.transform(criteria); assertThat("Failed to map 'allowInlineScripts' option", options.getAllowInl... | public ExecutionRequestOptions transform(ReportExportOptions options) { ExecutionRequestOptions resultOptions = ExecutionRequestOptions.create(); ReportFormat format = options.getFormat(); resultOptions.withOutputFormat(format.toString().toLowerCase()); PageRange pageRange = options.getPageRange(); if (pageRange != nul... | ExportOptionsMapper { public ExecutionRequestOptions transform(ReportExportOptions options) { ExecutionRequestOptions resultOptions = ExecutionRequestOptions.create(); ReportFormat format = options.getFormat(); resultOptions.withOutputFormat(format.toString().toLowerCase()); PageRange pageRange = options.getPageRange()... | ExportOptionsMapper { public ExecutionRequestOptions transform(ReportExportOptions options) { ExecutionRequestOptions resultOptions = ExecutionRequestOptions.create(); ReportFormat format = options.getFormat(); resultOptions.withOutputFormat(format.toString().toLowerCase()); PageRange pageRange = options.getPageRange()... | ExportOptionsMapper { public ExecutionRequestOptions transform(ReportExportOptions options) { ExecutionRequestOptions resultOptions = ExecutionRequestOptions.create(); ReportFormat format = options.getFormat(); resultOptions.withOutputFormat(format.toString().toLowerCase()); PageRange pageRange = options.getPageRange()... | ExportOptionsMapper { public ExecutionRequestOptions transform(ReportExportOptions options) { ExecutionRequestOptions resultOptions = ExecutionRequestOptions.create(); ReportFormat format = options.getFormat(); resultOptions.withOutputFormat(format.toString().toLowerCase()); PageRange pageRange = options.getPageRange()... |
@Test public void should_map_baseUrl() { ReportExportOptions criteria = ReportExportOptions.builder() .withFormat(ReportFormat.PDF) .build(); ExecutionRequestOptions options = mapper.transform(criteria); assertThat("Failed to map 'baseUrl' option", options.getBaseUrl(), is(BASE_URL)); } | public ExecutionRequestOptions transform(ReportExportOptions options) { ExecutionRequestOptions resultOptions = ExecutionRequestOptions.create(); ReportFormat format = options.getFormat(); resultOptions.withOutputFormat(format.toString().toLowerCase()); PageRange pageRange = options.getPageRange(); if (pageRange != nul... | ExportOptionsMapper { public ExecutionRequestOptions transform(ReportExportOptions options) { ExecutionRequestOptions resultOptions = ExecutionRequestOptions.create(); ReportFormat format = options.getFormat(); resultOptions.withOutputFormat(format.toString().toLowerCase()); PageRange pageRange = options.getPageRange()... | ExportOptionsMapper { public ExecutionRequestOptions transform(ReportExportOptions options) { ExecutionRequestOptions resultOptions = ExecutionRequestOptions.create(); ReportFormat format = options.getFormat(); resultOptions.withOutputFormat(format.toString().toLowerCase()); PageRange pageRange = options.getPageRange()... | ExportOptionsMapper { public ExecutionRequestOptions transform(ReportExportOptions options) { ExecutionRequestOptions resultOptions = ExecutionRequestOptions.create(); ReportFormat format = options.getFormat(); resultOptions.withOutputFormat(format.toString().toLowerCase()); PageRange pageRange = options.getPageRange()... | ExportOptionsMapper { public ExecutionRequestOptions transform(ReportExportOptions options) { ExecutionRequestOptions resultOptions = ExecutionRequestOptions.create(); ReportFormat format = options.getFormat(); resultOptions.withOutputFormat(format.toString().toLowerCase()); PageRange pageRange = options.getPageRange()... |
@Test public void should_map_simple_entity_trigger_to_form() throws Exception { givenEntityFormWithSimpleTrigger(); whenMapsEntityToForm(); verify(mSimpleTriggerMapper).mapEntityOnForm(formBuilder, providedFormEntity); } | @Override public void mapEntityOnForm(JobForm.Builder form, JobFormEntity entity) { JobSimpleTriggerEntity simpleTrigger = entity.getSimpleTrigger(); if (simpleTrigger == null) { mCalendarTriggerMapper.mapEntityOnForm(form, entity); } else { Integer recurrenceInterval = simpleTrigger.getRecurrenceInterval(); String rec... | JobTriggerMapper extends JobMapper { @Override public void mapEntityOnForm(JobForm.Builder form, JobFormEntity entity) { JobSimpleTriggerEntity simpleTrigger = entity.getSimpleTrigger(); if (simpleTrigger == null) { mCalendarTriggerMapper.mapEntityOnForm(form, entity); } else { Integer recurrenceInterval = simpleTrigge... | JobTriggerMapper extends JobMapper { @Override public void mapEntityOnForm(JobForm.Builder form, JobFormEntity entity) { JobSimpleTriggerEntity simpleTrigger = entity.getSimpleTrigger(); if (simpleTrigger == null) { mCalendarTriggerMapper.mapEntityOnForm(form, entity); } else { Integer recurrenceInterval = simpleTrigge... | JobTriggerMapper extends JobMapper { @Override public void mapEntityOnForm(JobForm.Builder form, JobFormEntity entity) { JobSimpleTriggerEntity simpleTrigger = entity.getSimpleTrigger(); if (simpleTrigger == null) { mCalendarTriggerMapper.mapEntityOnForm(form, entity); } else { Integer recurrenceInterval = simpleTrigge... | JobTriggerMapper extends JobMapper { @Override public void mapEntityOnForm(JobForm.Builder form, JobFormEntity entity) { JobSimpleTriggerEntity simpleTrigger = entity.getSimpleTrigger(); if (simpleTrigger == null) { mCalendarTriggerMapper.mapEntityOnForm(form, entity); } else { Integer recurrenceInterval = simpleTrigge... |
@Test public void should_map_calendar_entity_trigger_to_form() throws Exception { givenEntityFormWithCalendarTrigger(); whenMapsEntityToForm(); verify(mCalendarTriggerMapper).mapEntityOnForm(formBuilder, providedFormEntity); } | @Override public void mapEntityOnForm(JobForm.Builder form, JobFormEntity entity) { JobSimpleTriggerEntity simpleTrigger = entity.getSimpleTrigger(); if (simpleTrigger == null) { mCalendarTriggerMapper.mapEntityOnForm(form, entity); } else { Integer recurrenceInterval = simpleTrigger.getRecurrenceInterval(); String rec... | JobTriggerMapper extends JobMapper { @Override public void mapEntityOnForm(JobForm.Builder form, JobFormEntity entity) { JobSimpleTriggerEntity simpleTrigger = entity.getSimpleTrigger(); if (simpleTrigger == null) { mCalendarTriggerMapper.mapEntityOnForm(form, entity); } else { Integer recurrenceInterval = simpleTrigge... | JobTriggerMapper extends JobMapper { @Override public void mapEntityOnForm(JobForm.Builder form, JobFormEntity entity) { JobSimpleTriggerEntity simpleTrigger = entity.getSimpleTrigger(); if (simpleTrigger == null) { mCalendarTriggerMapper.mapEntityOnForm(form, entity); } else { Integer recurrenceInterval = simpleTrigge... | JobTriggerMapper extends JobMapper { @Override public void mapEntityOnForm(JobForm.Builder form, JobFormEntity entity) { JobSimpleTriggerEntity simpleTrigger = entity.getSimpleTrigger(); if (simpleTrigger == null) { mCalendarTriggerMapper.mapEntityOnForm(form, entity); } else { Integer recurrenceInterval = simpleTrigge... | JobTriggerMapper extends JobMapper { @Override public void mapEntityOnForm(JobForm.Builder form, JobFormEntity entity) { JobSimpleTriggerEntity simpleTrigger = entity.getSimpleTrigger(); if (simpleTrigger == null) { mCalendarTriggerMapper.mapEntityOnForm(form, entity); } else { Integer recurrenceInterval = simpleTrigge... |
@Test public void should_map_none_entity_trigger_to_form() throws Exception { givenEntityFormWithNoneTrigger(); whenMapsEntityToForm(); verify(mNoneTriggerMapper).mapEntityOnForm(formBuilder, providedFormEntity); } | @Override public void mapEntityOnForm(JobForm.Builder form, JobFormEntity entity) { JobSimpleTriggerEntity simpleTrigger = entity.getSimpleTrigger(); if (simpleTrigger == null) { mCalendarTriggerMapper.mapEntityOnForm(form, entity); } else { Integer recurrenceInterval = simpleTrigger.getRecurrenceInterval(); String rec... | JobTriggerMapper extends JobMapper { @Override public void mapEntityOnForm(JobForm.Builder form, JobFormEntity entity) { JobSimpleTriggerEntity simpleTrigger = entity.getSimpleTrigger(); if (simpleTrigger == null) { mCalendarTriggerMapper.mapEntityOnForm(form, entity); } else { Integer recurrenceInterval = simpleTrigge... | JobTriggerMapper extends JobMapper { @Override public void mapEntityOnForm(JobForm.Builder form, JobFormEntity entity) { JobSimpleTriggerEntity simpleTrigger = entity.getSimpleTrigger(); if (simpleTrigger == null) { mCalendarTriggerMapper.mapEntityOnForm(form, entity); } else { Integer recurrenceInterval = simpleTrigge... | JobTriggerMapper extends JobMapper { @Override public void mapEntityOnForm(JobForm.Builder form, JobFormEntity entity) { JobSimpleTriggerEntity simpleTrigger = entity.getSimpleTrigger(); if (simpleTrigger == null) { mCalendarTriggerMapper.mapEntityOnForm(form, entity); } else { Integer recurrenceInterval = simpleTrigge... | JobTriggerMapper extends JobMapper { @Override public void mapEntityOnForm(JobForm.Builder form, JobFormEntity entity) { JobSimpleTriggerEntity simpleTrigger = entity.getSimpleTrigger(); if (simpleTrigger == null) { mCalendarTriggerMapper.mapEntityOnForm(form, entity); } else { Integer recurrenceInterval = simpleTrigge... |
@Test public void should_map_simple_trigger_to_entity() throws Exception { givenFormWithSimpleTrigger(); whenMapsFormToEntity(); verify(mSimpleTriggerMapper).mapFormOnEntity(providedForm, mappedFormEntity); } | @Override public void mapFormOnEntity(JobForm form, JobFormEntity entity) { Trigger trigger = form.getTrigger(); if (trigger == null) { mNoneTriggerMapper.mapFormOnEntity(form, entity); } else { Recurrence recurrence = trigger.getRecurrence(); if (recurrence instanceof CalendarRecurrence) { mCalendarTriggerMapper.mapFo... | JobTriggerMapper extends JobMapper { @Override public void mapFormOnEntity(JobForm form, JobFormEntity entity) { Trigger trigger = form.getTrigger(); if (trigger == null) { mNoneTriggerMapper.mapFormOnEntity(form, entity); } else { Recurrence recurrence = trigger.getRecurrence(); if (recurrence instanceof CalendarRecur... | JobTriggerMapper extends JobMapper { @Override public void mapFormOnEntity(JobForm form, JobFormEntity entity) { Trigger trigger = form.getTrigger(); if (trigger == null) { mNoneTriggerMapper.mapFormOnEntity(form, entity); } else { Recurrence recurrence = trigger.getRecurrence(); if (recurrence instanceof CalendarRecur... | JobTriggerMapper extends JobMapper { @Override public void mapFormOnEntity(JobForm form, JobFormEntity entity) { Trigger trigger = form.getTrigger(); if (trigger == null) { mNoneTriggerMapper.mapFormOnEntity(form, entity); } else { Recurrence recurrence = trigger.getRecurrence(); if (recurrence instanceof CalendarRecur... | JobTriggerMapper extends JobMapper { @Override public void mapFormOnEntity(JobForm form, JobFormEntity entity) { Trigger trigger = form.getTrigger(); if (trigger == null) { mNoneTriggerMapper.mapFormOnEntity(form, entity); } else { Recurrence recurrence = trigger.getRecurrence(); if (recurrence instanceof CalendarRecur... |
@Test public void should_map_calendar_trigger_to_entity() throws Exception { givenFormWithCalendarTrigger(); whenMapsFormToEntity(); verify(mCalendarTriggerMapper).mapFormOnEntity(providedForm, mappedFormEntity); } | @Override public void mapFormOnEntity(JobForm form, JobFormEntity entity) { Trigger trigger = form.getTrigger(); if (trigger == null) { mNoneTriggerMapper.mapFormOnEntity(form, entity); } else { Recurrence recurrence = trigger.getRecurrence(); if (recurrence instanceof CalendarRecurrence) { mCalendarTriggerMapper.mapFo... | JobTriggerMapper extends JobMapper { @Override public void mapFormOnEntity(JobForm form, JobFormEntity entity) { Trigger trigger = form.getTrigger(); if (trigger == null) { mNoneTriggerMapper.mapFormOnEntity(form, entity); } else { Recurrence recurrence = trigger.getRecurrence(); if (recurrence instanceof CalendarRecur... | JobTriggerMapper extends JobMapper { @Override public void mapFormOnEntity(JobForm form, JobFormEntity entity) { Trigger trigger = form.getTrigger(); if (trigger == null) { mNoneTriggerMapper.mapFormOnEntity(form, entity); } else { Recurrence recurrence = trigger.getRecurrence(); if (recurrence instanceof CalendarRecur... | JobTriggerMapper extends JobMapper { @Override public void mapFormOnEntity(JobForm form, JobFormEntity entity) { Trigger trigger = form.getTrigger(); if (trigger == null) { mNoneTriggerMapper.mapFormOnEntity(form, entity); } else { Recurrence recurrence = trigger.getRecurrence(); if (recurrence instanceof CalendarRecur... | JobTriggerMapper extends JobMapper { @Override public void mapFormOnEntity(JobForm form, JobFormEntity entity) { Trigger trigger = form.getTrigger(); if (trigger == null) { mNoneTriggerMapper.mapFormOnEntity(form, entity); } else { Recurrence recurrence = trigger.getRecurrence(); if (recurrence instanceof CalendarRecur... |
@Test public void shouldAggregateSinglePath() throws Exception { HttpUrl base = HttpUrl.parse("http: PathResolver resolver = new PathResolver.Builder() .addPath("path") .build(); HttpUrl expected = resolver.resolve(base); assertThat(expected, is(HttpUrl.parse("http: } | public HttpUrl resolve(HttpUrl base) { HttpUrl.Builder builder = base.newBuilder(); for (String path : mPaths) { builder.addPathSegment(path); } return builder.build(); } | PathResolver { public HttpUrl resolve(HttpUrl base) { HttpUrl.Builder builder = base.newBuilder(); for (String path : mPaths) { builder.addPathSegment(path); } return builder.build(); } } | PathResolver { public HttpUrl resolve(HttpUrl base) { HttpUrl.Builder builder = base.newBuilder(); for (String path : mPaths) { builder.addPathSegment(path); } return builder.build(); } PathResolver(List<String> paths); } | PathResolver { public HttpUrl resolve(HttpUrl base) { HttpUrl.Builder builder = base.newBuilder(); for (String path : mPaths) { builder.addPathSegment(path); } return builder.build(); } PathResolver(List<String> paths); HttpUrl resolve(HttpUrl base); } | PathResolver { public HttpUrl resolve(HttpUrl base) { HttpUrl.Builder builder = base.newBuilder(); for (String path : mPaths) { builder.addPathSegment(path); } return builder.build(); } PathResolver(List<String> paths); HttpUrl resolve(HttpUrl base); } |
@Test public void should_map_none_trigger_to_entity() throws Exception { givenFormWithNoneTrigger(); whenMapsFormToEntity(); verify(mNoneTriggerMapper).mapFormOnEntity(providedForm, mappedFormEntity); } | @Override public void mapFormOnEntity(JobForm form, JobFormEntity entity) { Trigger trigger = form.getTrigger(); if (trigger == null) { mNoneTriggerMapper.mapFormOnEntity(form, entity); } else { Recurrence recurrence = trigger.getRecurrence(); if (recurrence instanceof CalendarRecurrence) { mCalendarTriggerMapper.mapFo... | JobTriggerMapper extends JobMapper { @Override public void mapFormOnEntity(JobForm form, JobFormEntity entity) { Trigger trigger = form.getTrigger(); if (trigger == null) { mNoneTriggerMapper.mapFormOnEntity(form, entity); } else { Recurrence recurrence = trigger.getRecurrence(); if (recurrence instanceof CalendarRecur... | JobTriggerMapper extends JobMapper { @Override public void mapFormOnEntity(JobForm form, JobFormEntity entity) { Trigger trigger = form.getTrigger(); if (trigger == null) { mNoneTriggerMapper.mapFormOnEntity(form, entity); } else { Recurrence recurrence = trigger.getRecurrence(); if (recurrence instanceof CalendarRecur... | JobTriggerMapper extends JobMapper { @Override public void mapFormOnEntity(JobForm form, JobFormEntity entity) { Trigger trigger = form.getTrigger(); if (trigger == null) { mNoneTriggerMapper.mapFormOnEntity(form, entity); } else { Recurrence recurrence = trigger.getRecurrence(); if (recurrence instanceof CalendarRecur... | JobTriggerMapper extends JobMapper { @Override public void mapFormOnEntity(JobForm form, JobFormEntity entity) { Trigger trigger = form.getTrigger(); if (trigger == null) { mNoneTriggerMapper.mapFormOnEntity(form, entity); } else { Recurrence recurrence = trigger.getRecurrence(); if (recurrence instanceof CalendarRecur... |
@Test public void should_map_form_to_entity() throws Exception { List<ReportParameter> parameters = Collections.singletonList( new ReportParameter("key", Collections.singleton("value"))); JobSource source = new JobSource.Builder() .withUri("/my/uri") .withParameters(parameters) .build(); JobFormEntity mappedEntity = fo... | @Override public void mapFormOnEntity(JobForm form, JobFormEntity entity) { JobSource source = form.getSource(); List<ReportParameter> params = source.getParameters(); Map<String, Set<String>> values = mapSourceParamValues(params); entity.setSourceUri(source.getUri()); entity.setSourceParameters(values); } | JobSourceMapper extends JobMapper { @Override public void mapFormOnEntity(JobForm form, JobFormEntity entity) { JobSource source = form.getSource(); List<ReportParameter> params = source.getParameters(); Map<String, Set<String>> values = mapSourceParamValues(params); entity.setSourceUri(source.getUri()); entity.setSour... | JobSourceMapper extends JobMapper { @Override public void mapFormOnEntity(JobForm form, JobFormEntity entity) { JobSource source = form.getSource(); List<ReportParameter> params = source.getParameters(); Map<String, Set<String>> values = mapSourceParamValues(params); entity.setSourceUri(source.getUri()); entity.setSour... | JobSourceMapper extends JobMapper { @Override public void mapFormOnEntity(JobForm form, JobFormEntity entity) { JobSource source = form.getSource(); List<ReportParameter> params = source.getParameters(); Map<String, Set<String>> values = mapSourceParamValues(params); entity.setSourceUri(source.getUri()); entity.setSour... | JobSourceMapper extends JobMapper { @Override public void mapFormOnEntity(JobForm form, JobFormEntity entity) { JobSource source = form.getSource(); List<ReportParameter> params = source.getParameters(); Map<String, Set<String>> values = mapSourceParamValues(params); entity.setSourceUri(source.getUri()); entity.setSour... |
@Test public void should_map_entity_to_form() throws Exception { JobFormEntity preparedEntity = formFactory.givenJobFormEntityWithValues(); JobForm.Builder form = formFactory.givenJobFormBuilderWithValues(); mapperUnderTest.mapEntityOnForm(form, preparedEntity); JobSource source = form.build().getSource(); assertThat(s... | @Override public void mapEntityOnForm(JobForm.Builder form, JobFormEntity entity) { JobSource.Builder builder = new JobSource.Builder(); builder.withUri(entity.getSourceUri()); Map<String, Set<String>> parameters = entity.getSourceParameters(); if (parameters != null) { List<ReportParameter> params = mapParams(paramete... | JobSourceMapper extends JobMapper { @Override public void mapEntityOnForm(JobForm.Builder form, JobFormEntity entity) { JobSource.Builder builder = new JobSource.Builder(); builder.withUri(entity.getSourceUri()); Map<String, Set<String>> parameters = entity.getSourceParameters(); if (parameters != null) { List<ReportPa... | JobSourceMapper extends JobMapper { @Override public void mapEntityOnForm(JobForm.Builder form, JobFormEntity entity) { JobSource.Builder builder = new JobSource.Builder(); builder.withUri(entity.getSourceUri()); Map<String, Set<String>> parameters = entity.getSourceParameters(); if (parameters != null) { List<ReportPa... | JobSourceMapper extends JobMapper { @Override public void mapEntityOnForm(JobForm.Builder form, JobFormEntity entity) { JobSource.Builder builder = new JobSource.Builder(); builder.withUri(entity.getSourceUri()); Map<String, Set<String>> parameters = entity.getSourceParameters(); if (parameters != null) { List<ReportPa... | JobSourceMapper extends JobMapper { @Override public void mapEntityOnForm(JobForm.Builder form, JobFormEntity entity) { JobSource.Builder builder = new JobSource.Builder(); builder.withUri(entity.getSourceUri()); Map<String, Set<String>> parameters = entity.getSourceParameters(); if (parameters != null) { List<ReportPa... |
@Test public void should_perform_search() throws Exception { when(mScheduleRestApi.searchJob(anyMapOf(String.class, Object.class))).thenReturn(Collections.<JobUnitEntity>emptyList()); useCase.searchJob(CRITERIA); verify(mSearchCriteriaMapper).transform(CRITERIA); verify(mScheduleRestApi).searchJob(SEARCH_PARAMS); verif... | public List<JobUnit> searchJob(JobSearchCriteria criteria) throws ServiceException { try { Map<String, Object> searchParams = mSearchCriteriaMapper.transform(criteria); List<JobUnitEntity> jobUnitEntities = mScheduleRestApi.searchJob(searchParams); return mJobUnitMapper.transform(jobUnitEntities); } catch (IOException ... | ReportScheduleUseCase { public List<JobUnit> searchJob(JobSearchCriteria criteria) throws ServiceException { try { Map<String, Object> searchParams = mSearchCriteriaMapper.transform(criteria); List<JobUnitEntity> jobUnitEntities = mScheduleRestApi.searchJob(searchParams); return mJobUnitMapper.transform(jobUnitEntities... | ReportScheduleUseCase { public List<JobUnit> searchJob(JobSearchCriteria criteria) throws ServiceException { try { Map<String, Object> searchParams = mSearchCriteriaMapper.transform(criteria); List<JobUnitEntity> jobUnitEntities = mScheduleRestApi.searchJob(searchParams); return mJobUnitMapper.transform(jobUnitEntities... | ReportScheduleUseCase { public List<JobUnit> searchJob(JobSearchCriteria criteria) throws ServiceException { try { Map<String, Object> searchParams = mSearchCriteriaMapper.transform(criteria); List<JobUnitEntity> jobUnitEntities = mScheduleRestApi.searchJob(searchParams); return mJobUnitMapper.transform(jobUnitEntities... | ReportScheduleUseCase { public List<JobUnit> searchJob(JobSearchCriteria criteria) throws ServiceException { try { Map<String, Object> searchParams = mSearchCriteriaMapper.transform(criteria); List<JobUnitEntity> jobUnitEntities = mScheduleRestApi.searchJob(searchParams); return mJobUnitMapper.transform(jobUnitEntities... |
@Test public void should_perform_create_job() throws Exception { when(mScheduleRestApi.createJob(any(JobFormEntity.class))).thenReturn(mJobDescriptor); useCase.createJob(mJobForm); verify(mJobDataMapper).transform(mJobDescriptor, SIMPLE_DATE_FORMAT); verify(mScheduleRestApi).createJob(mJobFormEntity); } | 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,
... | ReportScheduleUseCase { public JobData createJob(JobForm form) throws ServiceException { return alterJob(form, null); } ReportScheduleUseCase(ServiceExceptionMapper exceptionMapper,
ReportScheduleRestApi scheduleRestApi,
InfoCacheManager cacheManager,
... | ReportScheduleUseCase { public JobData createJob(JobForm form) throws ServiceException { return alterJob(form, null); } ReportScheduleUseCase(ServiceExceptionMapper exceptionMapper,
ReportScheduleRestApi scheduleRestApi,
InfoCacheManager cacheManager,
... |
@Test public void should_perform_update_job() throws Exception { when(mScheduleRestApi.updateJob(anyInt(), any(JobFormEntity.class))).thenReturn(mJobDescriptor); useCase.updateJob(JOB_ID, mJobForm); verify(mJobDataMapper).transform(mJobDescriptor, SIMPLE_DATE_FORMAT); verify(mScheduleRestApi).updateJob(JOB_ID, mJobForm... | public JobData updateJob(int id, JobForm form) throws ServiceException { return alterJob(form, id); } | ReportScheduleUseCase { public JobData updateJob(int id, JobForm form) throws ServiceException { return alterJob(form, id); } } | ReportScheduleUseCase { public JobData updateJob(int id, JobForm form) throws ServiceException { return alterJob(form, id); } ReportScheduleUseCase(ServiceExceptionMapper exceptionMapper,
ReportScheduleRestApi scheduleRestApi,
InfoCacheManager cacheManager,
... | ReportScheduleUseCase { public JobData updateJob(int id, JobForm form) throws ServiceException { return alterJob(form, id); } ReportScheduleUseCase(ServiceExceptionMapper exceptionMapper,
ReportScheduleRestApi scheduleRestApi,
InfoCacheManager cacheManager,
... | ReportScheduleUseCase { public JobData updateJob(int id, JobForm form) throws ServiceException { return alterJob(form, id); } ReportScheduleUseCase(ServiceExceptionMapper exceptionMapper,
ReportScheduleRestApi scheduleRestApi,
InfoCacheManager cacheManager,
... |
@Test public void should_perform_delete_jobs() throws Exception { useCase.deleteJobs(JOB_IDS); verify(mScheduleRestApi).deleteJobs(JOB_IDS); } | public Set<Integer> deleteJobs(Set<Integer> jobIds) throws ServiceException { try { return mScheduleRestApi.deleteJobs(jobIds); } catch (IOException e) { throw mExceptionMapper.transform(e); } catch (HttpException e) { throw mExceptionMapper.transform(e); } } | ReportScheduleUseCase { public Set<Integer> deleteJobs(Set<Integer> jobIds) throws ServiceException { try { return mScheduleRestApi.deleteJobs(jobIds); } catch (IOException e) { throw mExceptionMapper.transform(e); } catch (HttpException e) { throw mExceptionMapper.transform(e); } } } | ReportScheduleUseCase { public Set<Integer> deleteJobs(Set<Integer> jobIds) throws ServiceException { try { return mScheduleRestApi.deleteJobs(jobIds); } catch (IOException e) { throw mExceptionMapper.transform(e); } catch (HttpException e) { throw mExceptionMapper.transform(e); } } ReportScheduleUseCase(ServiceExcepti... | ReportScheduleUseCase { public Set<Integer> deleteJobs(Set<Integer> jobIds) throws ServiceException { try { return mScheduleRestApi.deleteJobs(jobIds); } catch (IOException e) { throw mExceptionMapper.transform(e); } catch (HttpException e) { throw mExceptionMapper.transform(e); } } ReportScheduleUseCase(ServiceExcepti... | ReportScheduleUseCase { public Set<Integer> deleteJobs(Set<Integer> jobIds) throws ServiceException { try { return mScheduleRestApi.deleteJobs(jobIds); } catch (IOException e) { throw mExceptionMapper.transform(e); } catch (HttpException e) { throw mExceptionMapper.transform(e); } } ReportScheduleUseCase(ServiceExcepti... |
@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 { 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); }... |
@Test public void search_adapts_io_exception() throws Exception { when(mScheduleRestApi.searchJob(anyMapOf(String.class, Object.class))).thenThrow(mIOException); try { useCase.searchJob(CRITERIA); fail("Should adapt IO exception"); } catch (ServiceException ex) { verify(mExceptionMapper).transform(mIOException); } } | public List<JobUnit> searchJob(JobSearchCriteria criteria) throws ServiceException { try { Map<String, Object> searchParams = mSearchCriteriaMapper.transform(criteria); List<JobUnitEntity> jobUnitEntities = mScheduleRestApi.searchJob(searchParams); return mJobUnitMapper.transform(jobUnitEntities); } catch (IOException ... | ReportScheduleUseCase { public List<JobUnit> searchJob(JobSearchCriteria criteria) throws ServiceException { try { Map<String, Object> searchParams = mSearchCriteriaMapper.transform(criteria); List<JobUnitEntity> jobUnitEntities = mScheduleRestApi.searchJob(searchParams); return mJobUnitMapper.transform(jobUnitEntities... | ReportScheduleUseCase { public List<JobUnit> searchJob(JobSearchCriteria criteria) throws ServiceException { try { Map<String, Object> searchParams = mSearchCriteriaMapper.transform(criteria); List<JobUnitEntity> jobUnitEntities = mScheduleRestApi.searchJob(searchParams); return mJobUnitMapper.transform(jobUnitEntities... | ReportScheduleUseCase { public List<JobUnit> searchJob(JobSearchCriteria criteria) throws ServiceException { try { Map<String, Object> searchParams = mSearchCriteriaMapper.transform(criteria); List<JobUnitEntity> jobUnitEntities = mScheduleRestApi.searchJob(searchParams); return mJobUnitMapper.transform(jobUnitEntities... | ReportScheduleUseCase { public List<JobUnit> searchJob(JobSearchCriteria criteria) throws ServiceException { try { Map<String, Object> searchParams = mSearchCriteriaMapper.transform(criteria); List<JobUnitEntity> jobUnitEntities = mScheduleRestApi.searchJob(searchParams); return mJobUnitMapper.transform(jobUnitEntities... |
@Test public void search_adapts_http_exception() throws Exception { when(mScheduleRestApi.searchJob(anyMapOf(String.class, Object.class))).thenThrow(mHttpException); try { useCase.searchJob(CRITERIA); fail("Should adapt HTTP exception"); } catch (ServiceException ex) { verify(mExceptionMapper).transform(mHttpException)... | public List<JobUnit> searchJob(JobSearchCriteria criteria) throws ServiceException { try { Map<String, Object> searchParams = mSearchCriteriaMapper.transform(criteria); List<JobUnitEntity> jobUnitEntities = mScheduleRestApi.searchJob(searchParams); return mJobUnitMapper.transform(jobUnitEntities); } catch (IOException ... | ReportScheduleUseCase { public List<JobUnit> searchJob(JobSearchCriteria criteria) throws ServiceException { try { Map<String, Object> searchParams = mSearchCriteriaMapper.transform(criteria); List<JobUnitEntity> jobUnitEntities = mScheduleRestApi.searchJob(searchParams); return mJobUnitMapper.transform(jobUnitEntities... | ReportScheduleUseCase { public List<JobUnit> searchJob(JobSearchCriteria criteria) throws ServiceException { try { Map<String, Object> searchParams = mSearchCriteriaMapper.transform(criteria); List<JobUnitEntity> jobUnitEntities = mScheduleRestApi.searchJob(searchParams); return mJobUnitMapper.transform(jobUnitEntities... | ReportScheduleUseCase { public List<JobUnit> searchJob(JobSearchCriteria criteria) throws ServiceException { try { Map<String, Object> searchParams = mSearchCriteriaMapper.transform(criteria); List<JobUnitEntity> jobUnitEntities = mScheduleRestApi.searchJob(searchParams); return mJobUnitMapper.transform(jobUnitEntities... | ReportScheduleUseCase { public List<JobUnit> searchJob(JobSearchCriteria criteria) throws ServiceException { try { Map<String, Object> searchParams = mSearchCriteriaMapper.transform(criteria); List<JobUnitEntity> jobUnitEntities = mScheduleRestApi.searchJob(searchParams); return mJobUnitMapper.transform(jobUnitEntities... |
@Test public void shouldAggregateMultiplePaths() throws Exception { HttpUrl base = HttpUrl.parse("http: PathResolver resolver = new PathResolver.Builder() .addPaths("/path/a/b") .build(); HttpUrl expected = resolver.resolve(base); assertThat(expected, is(HttpUrl.parse("http: } | public HttpUrl resolve(HttpUrl base) { HttpUrl.Builder builder = base.newBuilder(); for (String path : mPaths) { builder.addPathSegment(path); } return builder.build(); } | PathResolver { public HttpUrl resolve(HttpUrl base) { HttpUrl.Builder builder = base.newBuilder(); for (String path : mPaths) { builder.addPathSegment(path); } return builder.build(); } } | PathResolver { public HttpUrl resolve(HttpUrl base) { HttpUrl.Builder builder = base.newBuilder(); for (String path : mPaths) { builder.addPathSegment(path); } return builder.build(); } PathResolver(List<String> paths); } | PathResolver { public HttpUrl resolve(HttpUrl base) { HttpUrl.Builder builder = base.newBuilder(); for (String path : mPaths) { builder.addPathSegment(path); } return builder.build(); } PathResolver(List<String> paths); HttpUrl resolve(HttpUrl base); } | PathResolver { public HttpUrl resolve(HttpUrl base) { HttpUrl.Builder builder = base.newBuilder(); for (String path : mPaths) { builder.addPathSegment(path); } return builder.build(); } PathResolver(List<String> paths); HttpUrl resolve(HttpUrl base); } |
@Test public void bodyShouldNotBeNullForRunRequestExecution() throws Exception { mExpectedException.expect(NullPointerException.class); mExpectedException.expectMessage("Execution options should not be null"); restApiUnderTest.runExportExecution("any_id", null); } | @NotNull public ExportExecutionDescriptor runExportExecution(@NotNull String executionId, @NotNull ExecutionRequestOptions executionOptions) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(executionOptions, "Execution options should not be null"... | ReportExportRestApi { @NotNull public ExportExecutionDescriptor runExportExecution(@NotNull String executionId, @NotNull ExecutionRequestOptions executionOptions) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(executionOptions, "Execution optio... | ReportExportRestApi { @NotNull public ExportExecutionDescriptor runExportExecution(@NotNull String executionId, @NotNull ExecutionRequestOptions executionOptions) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(executionOptions, "Execution optio... | ReportExportRestApi { @NotNull public ExportExecutionDescriptor runExportExecution(@NotNull String executionId, @NotNull ExecutionRequestOptions executionOptions) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(executionOptions, "Execution optio... | ReportExportRestApi { @NotNull public ExportExecutionDescriptor runExportExecution(@NotNull String executionId, @NotNull ExecutionRequestOptions executionOptions) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(executionOptions, "Execution optio... |
@Test public void delete_jobs_adapts_io_exception() throws Exception { when(mScheduleRestApi.deleteJobs(anySetOf(Integer.class))).thenThrow(mIOException); try { useCase.deleteJobs(JOB_IDS); fail("Should adapt IO exception"); } catch (ServiceException ex) { verify(mExceptionMapper).transform(mIOException); } } | public Set<Integer> deleteJobs(Set<Integer> jobIds) throws ServiceException { try { return mScheduleRestApi.deleteJobs(jobIds); } catch (IOException e) { throw mExceptionMapper.transform(e); } catch (HttpException e) { throw mExceptionMapper.transform(e); } } | ReportScheduleUseCase { public Set<Integer> deleteJobs(Set<Integer> jobIds) throws ServiceException { try { return mScheduleRestApi.deleteJobs(jobIds); } catch (IOException e) { throw mExceptionMapper.transform(e); } catch (HttpException e) { throw mExceptionMapper.transform(e); } } } | ReportScheduleUseCase { public Set<Integer> deleteJobs(Set<Integer> jobIds) throws ServiceException { try { return mScheduleRestApi.deleteJobs(jobIds); } catch (IOException e) { throw mExceptionMapper.transform(e); } catch (HttpException e) { throw mExceptionMapper.transform(e); } } ReportScheduleUseCase(ServiceExcepti... | ReportScheduleUseCase { public Set<Integer> deleteJobs(Set<Integer> jobIds) throws ServiceException { try { return mScheduleRestApi.deleteJobs(jobIds); } catch (IOException e) { throw mExceptionMapper.transform(e); } catch (HttpException e) { throw mExceptionMapper.transform(e); } } ReportScheduleUseCase(ServiceExcepti... | ReportScheduleUseCase { public Set<Integer> deleteJobs(Set<Integer> jobIds) throws ServiceException { try { return mScheduleRestApi.deleteJobs(jobIds); } catch (IOException e) { throw mExceptionMapper.transform(e); } catch (HttpException e) { throw mExceptionMapper.transform(e); } } ReportScheduleUseCase(ServiceExcepti... |
@Test public void delete_jobs_adapts_http_exception() throws Exception { when(mScheduleRestApi.deleteJobs(anySetOf(Integer.class))).thenThrow(mHttpException); try { useCase.deleteJobs(JOB_IDS); fail("Should adapt HTTP exception"); } catch (ServiceException ex) { verify(mExceptionMapper).transform(mHttpException); } } | public Set<Integer> deleteJobs(Set<Integer> jobIds) throws ServiceException { try { return mScheduleRestApi.deleteJobs(jobIds); } catch (IOException e) { throw mExceptionMapper.transform(e); } catch (HttpException e) { throw mExceptionMapper.transform(e); } } | ReportScheduleUseCase { public Set<Integer> deleteJobs(Set<Integer> jobIds) throws ServiceException { try { return mScheduleRestApi.deleteJobs(jobIds); } catch (IOException e) { throw mExceptionMapper.transform(e); } catch (HttpException e) { throw mExceptionMapper.transform(e); } } } | ReportScheduleUseCase { public Set<Integer> deleteJobs(Set<Integer> jobIds) throws ServiceException { try { return mScheduleRestApi.deleteJobs(jobIds); } catch (IOException e) { throw mExceptionMapper.transform(e); } catch (HttpException e) { throw mExceptionMapper.transform(e); } } ReportScheduleUseCase(ServiceExcepti... | ReportScheduleUseCase { public Set<Integer> deleteJobs(Set<Integer> jobIds) throws ServiceException { try { return mScheduleRestApi.deleteJobs(jobIds); } catch (IOException e) { throw mExceptionMapper.transform(e); } catch (HttpException e) { throw mExceptionMapper.transform(e); } } ReportScheduleUseCase(ServiceExcepti... | ReportScheduleUseCase { public Set<Integer> deleteJobs(Set<Integer> jobIds) throws ServiceException { try { return mScheduleRestApi.deleteJobs(jobIds); } catch (IOException e) { throw mExceptionMapper.transform(e); } catch (HttpException e) { throw mExceptionMapper.transform(e); } } ReportScheduleUseCase(ServiceExcepti... |
@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,
... | ReportScheduleUseCase { public JobData createJob(JobForm form) throws ServiceException { return alterJob(form, null); } ReportScheduleUseCase(ServiceExceptionMapper exceptionMapper,
ReportScheduleRestApi scheduleRestApi,
InfoCacheManager cacheManager,
... | ReportScheduleUseCase { public JobData createJob(JobForm form) throws ServiceException { return alterJob(form, null); } ReportScheduleUseCase(ServiceExceptionMapper exceptionMapper,
ReportScheduleRestApi scheduleRestApi,
InfoCacheManager cacheManager,
... |
@Test public void create_job_adapts_http_exception() throws Exception { when(mScheduleRestApi.createJob(any(JobFormEntity.class))).thenThrow(mHttpException); try { useCase.createJob(mJobForm); fail("Should adapt HTTP exception"); } catch (ServiceException ex) { verify(mExceptionMapper).transform(mHttpException); } } | 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,
... | ReportScheduleUseCase { public JobData createJob(JobForm form) throws ServiceException { return alterJob(form, null); } ReportScheduleUseCase(ServiceExceptionMapper exceptionMapper,
ReportScheduleRestApi scheduleRestApi,
InfoCacheManager cacheManager,
... | ReportScheduleUseCase { public JobData createJob(JobForm form) throws ServiceException { return alterJob(form, null); } ReportScheduleUseCase(ServiceExceptionMapper exceptionMapper,
ReportScheduleRestApi scheduleRestApi,
InfoCacheManager cacheManager,
... |
@Test public void read_job_adapts_io_exception() throws Exception { when(mScheduleRestApi.requestJob(anyInt())).thenThrow(mIOException); try { useCase.readJob(JOB_ID); fail("Should adapt IO exception"); } catch (ServiceException ex) { verify(mExceptionMapper).transform(mIOException); } } | 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 { 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); }... |
@Test public void read_job_adapts_http_exception() throws Exception { when(mScheduleRestApi.requestJob(anyInt())).thenThrow(mHttpException); try { useCase.readJob(JOB_ID); fail("Should adapt HTTP exception"); } catch (ServiceException ex) { verify(mExceptionMapper).transform(mHttpException); } } | 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 { 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); }... |
@Test public void should_map_collection_of_units() throws Exception { List<JobUnitEntity> entities = Collections.singletonList(mJobUnitEntity); List<JobUnit> expected = mJobUnitMapper.transform(entities); assertThat(expected.size(), is(1)); } | public List<JobUnit> transform(List<JobUnitEntity> entities) { List<JobUnit> list = new ArrayList<>(entities.size()); for (JobUnitEntity entity : entities) { if (entity != null) { JobUnit unit = transform(entity); list.add(unit); } } return list; } | JobUnitMapper { public List<JobUnit> transform(List<JobUnitEntity> entities) { List<JobUnit> list = new ArrayList<>(entities.size()); for (JobUnitEntity entity : entities) { if (entity != null) { JobUnit unit = transform(entity); list.add(unit); } } return list; } } | JobUnitMapper { public List<JobUnit> transform(List<JobUnitEntity> entities) { List<JobUnit> list = new ArrayList<>(entities.size()); for (JobUnitEntity entity : entities) { if (entity != null) { JobUnit unit = transform(entity); list.add(unit); } } return list; } JobUnitMapper(JobUnitDateParser jobUnitDateParser); } | JobUnitMapper { public List<JobUnit> transform(List<JobUnitEntity> entities) { List<JobUnit> list = new ArrayList<>(entities.size()); for (JobUnitEntity entity : entities) { if (entity != null) { JobUnit unit = transform(entity); list.add(unit); } } return list; } JobUnitMapper(JobUnitDateParser jobUnitDateParser); Lis... | JobUnitMapper { public List<JobUnit> transform(List<JobUnitEntity> entities) { List<JobUnit> list = new ArrayList<>(entities.size()); for (JobUnitEntity entity : entities) { if (entity != null) { JobUnit unit = transform(entity); list.add(unit); } } return list; } JobUnitMapper(JobUnitDateParser jobUnitDateParser); Lis... |
@Test public void should_map_entity_to_service_counterpart() throws Exception { JobUnit expected = mJobUnitMapper.transform(mJobUnitEntity); assertThat(expected.getId(), is(1)); assertThat(expected.getVersion(), is(100)); assertThat(expected.getLabel(), is("label")); assertThat(expected.getDescription(), is("descriptio... | public List<JobUnit> transform(List<JobUnitEntity> entities) { List<JobUnit> list = new ArrayList<>(entities.size()); for (JobUnitEntity entity : entities) { if (entity != null) { JobUnit unit = transform(entity); list.add(unit); } } return list; } | JobUnitMapper { public List<JobUnit> transform(List<JobUnitEntity> entities) { List<JobUnit> list = new ArrayList<>(entities.size()); for (JobUnitEntity entity : entities) { if (entity != null) { JobUnit unit = transform(entity); list.add(unit); } } return list; } } | JobUnitMapper { public List<JobUnit> transform(List<JobUnitEntity> entities) { List<JobUnit> list = new ArrayList<>(entities.size()); for (JobUnitEntity entity : entities) { if (entity != null) { JobUnit unit = transform(entity); list.add(unit); } } return list; } JobUnitMapper(JobUnitDateParser jobUnitDateParser); } | JobUnitMapper { public List<JobUnit> transform(List<JobUnitEntity> entities) { List<JobUnit> list = new ArrayList<>(entities.size()); for (JobUnitEntity entity : entities) { if (entity != null) { JobUnit unit = transform(entity); list.add(unit); } } return list; } JobUnitMapper(JobUnitDateParser jobUnitDateParser); Lis... | JobUnitMapper { public List<JobUnit> transform(List<JobUnitEntity> entities) { List<JobUnit> list = new ArrayList<>(entities.size()); for (JobUnitEntity entity : entities) { if (entity != null) { JobUnit unit = transform(entity); list.add(unit); } } return list; } JobUnitMapper(JobUnitDateParser jobUnitDateParser); Lis... |
@Test public void should_map_on_entity() throws Exception { JobFormEntity formEntity = formFactory.givenNewJobFormEntity(); JobForm form = formFactory.givenJobFormBuilderWithValues() .withStartDate(null) .build(); mapperUnderTest.mapFormOnEntity(form, formEntity); JobSimpleTriggerEntity simpleTrigger = formEntity.getSi... | @Override public void mapFormOnEntity(JobForm form, JobFormEntity entity) { JobSimpleTriggerEntity triggerEntity = new JobSimpleTriggerEntity(); mapCommonTriggerFieldsOnEntity(form, triggerEntity); triggerEntity.setOccurrenceCount(1); triggerEntity.setRecurrenceInterval(1); triggerEntity.setRecurrenceIntervalUnit("DAY"... | JobNoneTriggerMapper extends BaseTriggerMapper { @Override public void mapFormOnEntity(JobForm form, JobFormEntity entity) { JobSimpleTriggerEntity triggerEntity = new JobSimpleTriggerEntity(); mapCommonTriggerFieldsOnEntity(form, triggerEntity); triggerEntity.setOccurrenceCount(1); triggerEntity.setRecurrenceInterval(... | JobNoneTriggerMapper extends BaseTriggerMapper { @Override public void mapFormOnEntity(JobForm form, JobFormEntity entity) { JobSimpleTriggerEntity triggerEntity = new JobSimpleTriggerEntity(); mapCommonTriggerFieldsOnEntity(form, triggerEntity); triggerEntity.setOccurrenceCount(1); triggerEntity.setRecurrenceInterval(... | JobNoneTriggerMapper extends BaseTriggerMapper { @Override public void mapFormOnEntity(JobForm form, JobFormEntity entity) { JobSimpleTriggerEntity triggerEntity = new JobSimpleTriggerEntity(); mapCommonTriggerFieldsOnEntity(form, triggerEntity); triggerEntity.setOccurrenceCount(1); triggerEntity.setRecurrenceInterval(... | JobNoneTriggerMapper extends BaseTriggerMapper { @Override public void mapFormOnEntity(JobForm form, JobFormEntity entity) { JobSimpleTriggerEntity triggerEntity = new JobSimpleTriggerEntity(); mapCommonTriggerFieldsOnEntity(form, triggerEntity); triggerEntity.setOccurrenceCount(1); triggerEntity.setRecurrenceInterval(... |
@Test public void should_map_start_date_on_entity() throws Exception { JobFormEntity formEntity = formFactory.givenNewJobFormEntity(); JobForm form = formFactory.givenJobFormWithValues(); mapperUnderTest.mapFormOnEntity(form, formEntity); JobSimpleTriggerEntity simpleTrigger = formEntity.getSimpleTrigger(); assertThat(... | @Override public void mapFormOnEntity(JobForm form, JobFormEntity entity) { JobSimpleTriggerEntity triggerEntity = new JobSimpleTriggerEntity(); mapCommonTriggerFieldsOnEntity(form, triggerEntity); triggerEntity.setOccurrenceCount(1); triggerEntity.setRecurrenceInterval(1); triggerEntity.setRecurrenceIntervalUnit("DAY"... | JobNoneTriggerMapper extends BaseTriggerMapper { @Override public void mapFormOnEntity(JobForm form, JobFormEntity entity) { JobSimpleTriggerEntity triggerEntity = new JobSimpleTriggerEntity(); mapCommonTriggerFieldsOnEntity(form, triggerEntity); triggerEntity.setOccurrenceCount(1); triggerEntity.setRecurrenceInterval(... | JobNoneTriggerMapper extends BaseTriggerMapper { @Override public void mapFormOnEntity(JobForm form, JobFormEntity entity) { JobSimpleTriggerEntity triggerEntity = new JobSimpleTriggerEntity(); mapCommonTriggerFieldsOnEntity(form, triggerEntity); triggerEntity.setOccurrenceCount(1); triggerEntity.setRecurrenceInterval(... | JobNoneTriggerMapper extends BaseTriggerMapper { @Override public void mapFormOnEntity(JobForm form, JobFormEntity entity) { JobSimpleTriggerEntity triggerEntity = new JobSimpleTriggerEntity(); mapCommonTriggerFieldsOnEntity(form, triggerEntity); triggerEntity.setOccurrenceCount(1); triggerEntity.setRecurrenceInterval(... | JobNoneTriggerMapper extends BaseTriggerMapper { @Override public void mapFormOnEntity(JobForm form, JobFormEntity entity) { JobSimpleTriggerEntity triggerEntity = new JobSimpleTriggerEntity(); mapCommonTriggerFieldsOnEntity(form, triggerEntity); triggerEntity.setOccurrenceCount(1); triggerEntity.setRecurrenceInterval(... |
@Test public void shouldAggregateSinglePathAsItIs() throws Exception { HttpUrl base = HttpUrl.parse("http: PathResolver resolver = new PathResolver.Builder() .addPaths("path") .build(); HttpUrl expected = resolver.resolve(base); assertThat(expected, is(HttpUrl.parse("http: } | public HttpUrl resolve(HttpUrl base) { HttpUrl.Builder builder = base.newBuilder(); for (String path : mPaths) { builder.addPathSegment(path); } return builder.build(); } | PathResolver { public HttpUrl resolve(HttpUrl base) { HttpUrl.Builder builder = base.newBuilder(); for (String path : mPaths) { builder.addPathSegment(path); } return builder.build(); } } | PathResolver { public HttpUrl resolve(HttpUrl base) { HttpUrl.Builder builder = base.newBuilder(); for (String path : mPaths) { builder.addPathSegment(path); } return builder.build(); } PathResolver(List<String> paths); } | PathResolver { public HttpUrl resolve(HttpUrl base) { HttpUrl.Builder builder = base.newBuilder(); for (String path : mPaths) { builder.addPathSegment(path); } return builder.build(); } PathResolver(List<String> paths); HttpUrl resolve(HttpUrl base); } | PathResolver { public HttpUrl resolve(HttpUrl base) { HttpUrl.Builder builder = base.newBuilder(); for (String path : mPaths) { builder.addPathSegment(path); } return builder.build(); } PathResolver(List<String> paths); HttpUrl resolve(HttpUrl base); } |
@Test public void should_map_none_trigger_type_as_simple_one() throws Exception { JobForm.Builder formBuilder = formFactory.givenJobFormBuilderWithValues(); JobFormEntity jobFormEntity = formFactory.givenJobFormEntityWithValues(); JobSimpleTriggerEntity simpleTrigger = new JobSimpleTriggerEntity(); simpleTrigger.setOcc... | @Override public void mapEntityOnForm(JobForm.Builder form, JobFormEntity entity) { mapCommonEntityTriggerFieldsOnEntity(form, entity); } | JobNoneTriggerMapper extends BaseTriggerMapper { @Override public void mapEntityOnForm(JobForm.Builder form, JobFormEntity entity) { mapCommonEntityTriggerFieldsOnEntity(form, entity); } } | JobNoneTriggerMapper extends BaseTriggerMapper { @Override public void mapEntityOnForm(JobForm.Builder form, JobFormEntity entity) { mapCommonEntityTriggerFieldsOnEntity(form, entity); } } | JobNoneTriggerMapper extends BaseTriggerMapper { @Override public void mapEntityOnForm(JobForm.Builder form, JobFormEntity entity) { mapCommonEntityTriggerFieldsOnEntity(form, entity); } @Override void mapFormOnEntity(JobForm form, JobFormEntity entity); @Override void mapEntityOnForm(JobForm.Builder form, JobFormEnti... | JobNoneTriggerMapper extends BaseTriggerMapper { @Override public void mapEntityOnForm(JobForm.Builder form, JobFormEntity entity) { mapCommonEntityTriggerFieldsOnEntity(form, entity); } @Override void mapFormOnEntity(JobForm form, JobFormEntity entity); @Override void mapEntityOnForm(JobForm.Builder form, JobFormEnti... |
@Test public void should_map_on_entity() throws Exception { CalendarRecurrence recurrence = new CalendarRecurrence.Builder() .withMonths(Calendar.JANUARY, Calendar.FEBRUARY) .withHours(HoursTimeFormat.parse("1")) .withMinutes(MinutesTimeFormat.parse("2")) .build(); Trigger trigger = new Trigger.Builder() .withCalendarN... | @Override public void mapFormOnEntity(JobForm form, JobFormEntity entity) { Trigger trigger = form.getTrigger(); CalendarRecurrence recurrence = (CalendarRecurrence) trigger.getRecurrence(); JobCalendarTriggerEntity calendarTrigger = new JobCalendarTriggerEntity(); calendarTrigger.setCalendarName(trigger.getCalendarNam... | JobCalendarTriggerMapper extends BaseTriggerMapper { @Override public void mapFormOnEntity(JobForm form, JobFormEntity entity) { Trigger trigger = form.getTrigger(); CalendarRecurrence recurrence = (CalendarRecurrence) trigger.getRecurrence(); JobCalendarTriggerEntity calendarTrigger = new JobCalendarTriggerEntity(); c... | JobCalendarTriggerMapper extends BaseTriggerMapper { @Override public void mapFormOnEntity(JobForm form, JobFormEntity entity) { Trigger trigger = form.getTrigger(); CalendarRecurrence recurrence = (CalendarRecurrence) trigger.getRecurrence(); JobCalendarTriggerEntity calendarTrigger = new JobCalendarTriggerEntity(); c... | JobCalendarTriggerMapper extends BaseTriggerMapper { @Override public void mapFormOnEntity(JobForm form, JobFormEntity entity) { Trigger trigger = form.getTrigger(); CalendarRecurrence recurrence = (CalendarRecurrence) trigger.getRecurrence(); JobCalendarTriggerEntity calendarTrigger = new JobCalendarTriggerEntity(); c... | JobCalendarTriggerMapper extends BaseTriggerMapper { @Override public void mapFormOnEntity(JobForm form, JobFormEntity entity) { Trigger trigger = form.getTrigger(); CalendarRecurrence recurrence = (CalendarRecurrence) trigger.getRecurrence(); JobCalendarTriggerEntity calendarTrigger = new JobCalendarTriggerEntity(); c... |
@Test public void should_map_with_day_type_days_in_week() throws Exception { CalendarRecurrence recurrence = new CalendarRecurrence.Builder() .withMonths(Calendar.JANUARY, Calendar.FEBRUARY) .withHours(HoursTimeFormat.parse("1")) .withMinutes(MinutesTimeFormat.parse("2")) .withDaysInWeek(Calendar.MONDAY, Calendar.THURS... | @Override public void mapFormOnEntity(JobForm form, JobFormEntity entity) { Trigger trigger = form.getTrigger(); CalendarRecurrence recurrence = (CalendarRecurrence) trigger.getRecurrence(); JobCalendarTriggerEntity calendarTrigger = new JobCalendarTriggerEntity(); calendarTrigger.setCalendarName(trigger.getCalendarNam... | JobCalendarTriggerMapper extends BaseTriggerMapper { @Override public void mapFormOnEntity(JobForm form, JobFormEntity entity) { Trigger trigger = form.getTrigger(); CalendarRecurrence recurrence = (CalendarRecurrence) trigger.getRecurrence(); JobCalendarTriggerEntity calendarTrigger = new JobCalendarTriggerEntity(); c... | JobCalendarTriggerMapper extends BaseTriggerMapper { @Override public void mapFormOnEntity(JobForm form, JobFormEntity entity) { Trigger trigger = form.getTrigger(); CalendarRecurrence recurrence = (CalendarRecurrence) trigger.getRecurrence(); JobCalendarTriggerEntity calendarTrigger = new JobCalendarTriggerEntity(); c... | JobCalendarTriggerMapper extends BaseTriggerMapper { @Override public void mapFormOnEntity(JobForm form, JobFormEntity entity) { Trigger trigger = form.getTrigger(); CalendarRecurrence recurrence = (CalendarRecurrence) trigger.getRecurrence(); JobCalendarTriggerEntity calendarTrigger = new JobCalendarTriggerEntity(); c... | JobCalendarTriggerMapper extends BaseTriggerMapper { @Override public void mapFormOnEntity(JobForm form, JobFormEntity entity) { Trigger trigger = form.getTrigger(); CalendarRecurrence recurrence = (CalendarRecurrence) trigger.getRecurrence(); JobCalendarTriggerEntity calendarTrigger = new JobCalendarTriggerEntity(); c... |
@Test public void should_map_with_day_type_days_in_month() throws Exception { CalendarRecurrence recurrence = new CalendarRecurrence.Builder() .withMonths(Calendar.JANUARY, Calendar.FEBRUARY) .withHours(HoursTimeFormat.parse("1")) .withMinutes(MinutesTimeFormat.parse("2")) .withDaysInMonth(DaysInMonth.valueOf("1")) .bu... | @Override public void mapFormOnEntity(JobForm form, JobFormEntity entity) { Trigger trigger = form.getTrigger(); CalendarRecurrence recurrence = (CalendarRecurrence) trigger.getRecurrence(); JobCalendarTriggerEntity calendarTrigger = new JobCalendarTriggerEntity(); calendarTrigger.setCalendarName(trigger.getCalendarNam... | JobCalendarTriggerMapper extends BaseTriggerMapper { @Override public void mapFormOnEntity(JobForm form, JobFormEntity entity) { Trigger trigger = form.getTrigger(); CalendarRecurrence recurrence = (CalendarRecurrence) trigger.getRecurrence(); JobCalendarTriggerEntity calendarTrigger = new JobCalendarTriggerEntity(); c... | JobCalendarTriggerMapper extends BaseTriggerMapper { @Override public void mapFormOnEntity(JobForm form, JobFormEntity entity) { Trigger trigger = form.getTrigger(); CalendarRecurrence recurrence = (CalendarRecurrence) trigger.getRecurrence(); JobCalendarTriggerEntity calendarTrigger = new JobCalendarTriggerEntity(); c... | JobCalendarTriggerMapper extends BaseTriggerMapper { @Override public void mapFormOnEntity(JobForm form, JobFormEntity entity) { Trigger trigger = form.getTrigger(); CalendarRecurrence recurrence = (CalendarRecurrence) trigger.getRecurrence(); JobCalendarTriggerEntity calendarTrigger = new JobCalendarTriggerEntity(); c... | JobCalendarTriggerMapper extends BaseTriggerMapper { @Override public void mapFormOnEntity(JobForm form, JobFormEntity entity) { Trigger trigger = form.getTrigger(); CalendarRecurrence recurrence = (CalendarRecurrence) trigger.getRecurrence(); JobCalendarTriggerEntity calendarTrigger = new JobCalendarTriggerEntity(); c... |
@Test public void should_map_calendar_trigger_with_all_type() throws Exception { JobCalendarTriggerEntity calendarTrigger = new JobCalendarTriggerEntity(); calendarTrigger.setMonths(new HashSet<>(Arrays.asList(Calendar.FEBRUARY + 1))); calendarTrigger.setMinutes("30"); calendarTrigger.setHours("3"); calendarTrigger.set... | @Override public void mapEntityOnForm(JobForm.Builder form, JobFormEntity entity) { JobCalendarTriggerEntity calendarTrigger = entity.getCalendarTrigger(); CalendarRecurrence.Builder recurrenceBuilder = new CalendarRecurrence.Builder() .withMinutes(MinutesTimeFormat.parse(calendarTrigger.getMinutes())) .withHours(Hours... | JobCalendarTriggerMapper extends BaseTriggerMapper { @Override public void mapEntityOnForm(JobForm.Builder form, JobFormEntity entity) { JobCalendarTriggerEntity calendarTrigger = entity.getCalendarTrigger(); CalendarRecurrence.Builder recurrenceBuilder = new CalendarRecurrence.Builder() .withMinutes(MinutesTimeFormat.... | JobCalendarTriggerMapper extends BaseTriggerMapper { @Override public void mapEntityOnForm(JobForm.Builder form, JobFormEntity entity) { JobCalendarTriggerEntity calendarTrigger = entity.getCalendarTrigger(); CalendarRecurrence.Builder recurrenceBuilder = new CalendarRecurrence.Builder() .withMinutes(MinutesTimeFormat.... | JobCalendarTriggerMapper extends BaseTriggerMapper { @Override public void mapEntityOnForm(JobForm.Builder form, JobFormEntity entity) { JobCalendarTriggerEntity calendarTrigger = entity.getCalendarTrigger(); CalendarRecurrence.Builder recurrenceBuilder = new CalendarRecurrence.Builder() .withMinutes(MinutesTimeFormat.... | JobCalendarTriggerMapper extends BaseTriggerMapper { @Override public void mapEntityOnForm(JobForm.Builder form, JobFormEntity entity) { JobCalendarTriggerEntity calendarTrigger = entity.getCalendarTrigger(); CalendarRecurrence.Builder recurrenceBuilder = new CalendarRecurrence.Builder() .withMinutes(MinutesTimeFormat.... |
@Test public void should_map_calendar_trigger_with_week_type() throws Exception { JobCalendarTriggerEntity calendarTrigger = new JobCalendarTriggerEntity(); calendarTrigger.setMonths(new HashSet<>(Arrays.asList(Calendar.FEBRUARY))); calendarTrigger.setWeekDays(new HashSet<>(Arrays.asList(Calendar.MONDAY))); calendarTri... | @Override public void mapEntityOnForm(JobForm.Builder form, JobFormEntity entity) { JobCalendarTriggerEntity calendarTrigger = entity.getCalendarTrigger(); CalendarRecurrence.Builder recurrenceBuilder = new CalendarRecurrence.Builder() .withMinutes(MinutesTimeFormat.parse(calendarTrigger.getMinutes())) .withHours(Hours... | JobCalendarTriggerMapper extends BaseTriggerMapper { @Override public void mapEntityOnForm(JobForm.Builder form, JobFormEntity entity) { JobCalendarTriggerEntity calendarTrigger = entity.getCalendarTrigger(); CalendarRecurrence.Builder recurrenceBuilder = new CalendarRecurrence.Builder() .withMinutes(MinutesTimeFormat.... | JobCalendarTriggerMapper extends BaseTriggerMapper { @Override public void mapEntityOnForm(JobForm.Builder form, JobFormEntity entity) { JobCalendarTriggerEntity calendarTrigger = entity.getCalendarTrigger(); CalendarRecurrence.Builder recurrenceBuilder = new CalendarRecurrence.Builder() .withMinutes(MinutesTimeFormat.... | JobCalendarTriggerMapper extends BaseTriggerMapper { @Override public void mapEntityOnForm(JobForm.Builder form, JobFormEntity entity) { JobCalendarTriggerEntity calendarTrigger = entity.getCalendarTrigger(); CalendarRecurrence.Builder recurrenceBuilder = new CalendarRecurrence.Builder() .withMinutes(MinutesTimeFormat.... | JobCalendarTriggerMapper extends BaseTriggerMapper { @Override public void mapEntityOnForm(JobForm.Builder form, JobFormEntity entity) { JobCalendarTriggerEntity calendarTrigger = entity.getCalendarTrigger(); CalendarRecurrence.Builder recurrenceBuilder = new CalendarRecurrence.Builder() .withMinutes(MinutesTimeFormat.... |
@Test public void should_map_calendar_trigger_with_month_type() throws Exception { JobCalendarTriggerEntity calendarTrigger = new JobCalendarTriggerEntity(); calendarTrigger.setMonths(new HashSet<>(Arrays.asList(Calendar.FEBRUARY))); calendarTrigger.setDaysType("MONTH"); calendarTrigger.setMonthDays("1"); formEntity.se... | @Override public void mapEntityOnForm(JobForm.Builder form, JobFormEntity entity) { JobCalendarTriggerEntity calendarTrigger = entity.getCalendarTrigger(); CalendarRecurrence.Builder recurrenceBuilder = new CalendarRecurrence.Builder() .withMinutes(MinutesTimeFormat.parse(calendarTrigger.getMinutes())) .withHours(Hours... | JobCalendarTriggerMapper extends BaseTriggerMapper { @Override public void mapEntityOnForm(JobForm.Builder form, JobFormEntity entity) { JobCalendarTriggerEntity calendarTrigger = entity.getCalendarTrigger(); CalendarRecurrence.Builder recurrenceBuilder = new CalendarRecurrence.Builder() .withMinutes(MinutesTimeFormat.... | JobCalendarTriggerMapper extends BaseTriggerMapper { @Override public void mapEntityOnForm(JobForm.Builder form, JobFormEntity entity) { JobCalendarTriggerEntity calendarTrigger = entity.getCalendarTrigger(); CalendarRecurrence.Builder recurrenceBuilder = new CalendarRecurrence.Builder() .withMinutes(MinutesTimeFormat.... | JobCalendarTriggerMapper extends BaseTriggerMapper { @Override public void mapEntityOnForm(JobForm.Builder form, JobFormEntity entity) { JobCalendarTriggerEntity calendarTrigger = entity.getCalendarTrigger(); CalendarRecurrence.Builder recurrenceBuilder = new CalendarRecurrence.Builder() .withMinutes(MinutesTimeFormat.... | JobCalendarTriggerMapper extends BaseTriggerMapper { @Override public void mapEntityOnForm(JobForm.Builder form, JobFormEntity entity) { JobCalendarTriggerEntity calendarTrigger = entity.getCalendarTrigger(); CalendarRecurrence.Builder recurrenceBuilder = new CalendarRecurrence.Builder() .withMinutes(MinutesTimeFormat.... |
@Test public void testTransform() throws Exception { long creationTime = DATE_FORMAT.parse("2013-10-03 16:32:05").getTime(); JobData jobData = jobDataMapper.transform(mJobDescriptor, DATE_FORMAT); assertThat("Should map id", jobData.getId(), is(20)); assertThat("Should map version", jobData.getVersion(), is(2)); assert... | public JobData transform(JobDescriptor jobDescriptor, SimpleDateFormat dateTimeFormat) { JobData.Builder builder = new JobData.Builder(); builder.withId(jobDescriptor.getId()); builder.withLabel(jobDescriptor.getLabel()); builder.withDescription(jobDescriptor.getDescription()); builder.withVersion(jobDescriptor.getVers... | JobDataMapper { public JobData transform(JobDescriptor jobDescriptor, SimpleDateFormat dateTimeFormat) { JobData.Builder builder = new JobData.Builder(); builder.withId(jobDescriptor.getId()); builder.withLabel(jobDescriptor.getLabel()); builder.withDescription(jobDescriptor.getDescription()); builder.withVersion(jobDe... | JobDataMapper { public JobData transform(JobDescriptor jobDescriptor, SimpleDateFormat dateTimeFormat) { JobData.Builder builder = new JobData.Builder(); builder.withId(jobDescriptor.getId()); builder.withLabel(jobDescriptor.getLabel()); builder.withDescription(jobDescriptor.getDescription()); builder.withVersion(jobDe... | JobDataMapper { public JobData transform(JobDescriptor jobDescriptor, SimpleDateFormat dateTimeFormat) { JobData.Builder builder = new JobData.Builder(); builder.withId(jobDescriptor.getId()); builder.withLabel(jobDescriptor.getLabel()); builder.withDescription(jobDescriptor.getDescription()); builder.withVersion(jobDe... | JobDataMapper { public JobData transform(JobDescriptor jobDescriptor, SimpleDateFormat dateTimeFormat) { JobData.Builder builder = new JobData.Builder(); builder.withId(jobDescriptor.getId()); builder.withLabel(jobDescriptor.getLabel()); builder.withDescription(jobDescriptor.getDescription()); builder.withVersion(jobDe... |
@Test public void should_map_simple_trigger_with_infinite_value_on_entity() throws Exception { IntervalRecurrence recurrence = new IntervalRecurrence.Builder() .withInterval(10) .withUnit(RecurrenceIntervalUnit.DAY) .build(); Trigger trigger = new Trigger.Builder() .withCalendarName("Gregorian") .withRecurrence(recurre... | @Override public void mapFormOnEntity(JobForm form, JobFormEntity entity) { Trigger trigger = form.getTrigger(); EndDate endDate = trigger.getEndDate(); JobSimpleTriggerEntity simpleTrigger = new JobSimpleTriggerEntity(); mapCommonTriggerFieldsOnEntity(form, simpleTrigger); IntervalRecurrence recurrence = (IntervalRecu... | JobSimpleTriggerMapper extends BaseTriggerMapper { @Override public void mapFormOnEntity(JobForm form, JobFormEntity entity) { Trigger trigger = form.getTrigger(); EndDate endDate = trigger.getEndDate(); JobSimpleTriggerEntity simpleTrigger = new JobSimpleTriggerEntity(); mapCommonTriggerFieldsOnEntity(form, simpleTrig... | JobSimpleTriggerMapper extends BaseTriggerMapper { @Override public void mapFormOnEntity(JobForm form, JobFormEntity entity) { Trigger trigger = form.getTrigger(); EndDate endDate = trigger.getEndDate(); JobSimpleTriggerEntity simpleTrigger = new JobSimpleTriggerEntity(); mapCommonTriggerFieldsOnEntity(form, simpleTrig... | JobSimpleTriggerMapper extends BaseTriggerMapper { @Override public void mapFormOnEntity(JobForm form, JobFormEntity entity) { Trigger trigger = form.getTrigger(); EndDate endDate = trigger.getEndDate(); JobSimpleTriggerEntity simpleTrigger = new JobSimpleTriggerEntity(); mapCommonTriggerFieldsOnEntity(form, simpleTrig... | JobSimpleTriggerMapper extends BaseTriggerMapper { @Override public void mapFormOnEntity(JobForm form, JobFormEntity entity) { Trigger trigger = form.getTrigger(); EndDate endDate = trigger.getEndDate(); JobSimpleTriggerEntity simpleTrigger = new JobSimpleTriggerEntity(); mapCommonTriggerFieldsOnEntity(form, simpleTrig... |
@Test public void should_map_simple_trigger_with_repeated_value_on_entity() throws Exception { IntervalRecurrence recurrence = new IntervalRecurrence.Builder() .withInterval(10) .withUnit(RecurrenceIntervalUnit.DAY) .build(); Trigger trigger = new Trigger.Builder() .withRecurrence(recurrence) .withEndDate(new RepeatedE... | @Override public void mapFormOnEntity(JobForm form, JobFormEntity entity) { Trigger trigger = form.getTrigger(); EndDate endDate = trigger.getEndDate(); JobSimpleTriggerEntity simpleTrigger = new JobSimpleTriggerEntity(); mapCommonTriggerFieldsOnEntity(form, simpleTrigger); IntervalRecurrence recurrence = (IntervalRecu... | JobSimpleTriggerMapper extends BaseTriggerMapper { @Override public void mapFormOnEntity(JobForm form, JobFormEntity entity) { Trigger trigger = form.getTrigger(); EndDate endDate = trigger.getEndDate(); JobSimpleTriggerEntity simpleTrigger = new JobSimpleTriggerEntity(); mapCommonTriggerFieldsOnEntity(form, simpleTrig... | JobSimpleTriggerMapper extends BaseTriggerMapper { @Override public void mapFormOnEntity(JobForm form, JobFormEntity entity) { Trigger trigger = form.getTrigger(); EndDate endDate = trigger.getEndDate(); JobSimpleTriggerEntity simpleTrigger = new JobSimpleTriggerEntity(); mapCommonTriggerFieldsOnEntity(form, simpleTrig... | JobSimpleTriggerMapper extends BaseTriggerMapper { @Override public void mapFormOnEntity(JobForm form, JobFormEntity entity) { Trigger trigger = form.getTrigger(); EndDate endDate = trigger.getEndDate(); JobSimpleTriggerEntity simpleTrigger = new JobSimpleTriggerEntity(); mapCommonTriggerFieldsOnEntity(form, simpleTrig... | JobSimpleTriggerMapper extends BaseTriggerMapper { @Override public void mapFormOnEntity(JobForm form, JobFormEntity entity) { Trigger trigger = form.getTrigger(); EndDate endDate = trigger.getEndDate(); JobSimpleTriggerEntity simpleTrigger = new JobSimpleTriggerEntity(); mapCommonTriggerFieldsOnEntity(form, simpleTrig... |
@Test public void shouldNotAggregatePathIfEmptinessSupplied() throws Exception { HttpUrl base = HttpUrl.parse("http: PathResolver resolver = new PathResolver.Builder() .addPath("") .build(); HttpUrl expected = resolver.resolve(base); assertThat(expected, is(HttpUrl.parse("http: PathResolver resolver2 = new PathResolver... | public HttpUrl resolve(HttpUrl base) { HttpUrl.Builder builder = base.newBuilder(); for (String path : mPaths) { builder.addPathSegment(path); } return builder.build(); } | PathResolver { public HttpUrl resolve(HttpUrl base) { HttpUrl.Builder builder = base.newBuilder(); for (String path : mPaths) { builder.addPathSegment(path); } return builder.build(); } } | PathResolver { public HttpUrl resolve(HttpUrl base) { HttpUrl.Builder builder = base.newBuilder(); for (String path : mPaths) { builder.addPathSegment(path); } return builder.build(); } PathResolver(List<String> paths); } | PathResolver { public HttpUrl resolve(HttpUrl base) { HttpUrl.Builder builder = base.newBuilder(); for (String path : mPaths) { builder.addPathSegment(path); } return builder.build(); } PathResolver(List<String> paths); HttpUrl resolve(HttpUrl base); } | PathResolver { public HttpUrl resolve(HttpUrl base) { HttpUrl.Builder builder = base.newBuilder(); for (String path : mPaths) { builder.addPathSegment(path); } return builder.build(); } PathResolver(List<String> paths); HttpUrl resolve(HttpUrl base); } |
@Test public void should_map_simple_trigger_with_until_date_value_on_entity() throws Exception { IntervalRecurrence recurrence = new IntervalRecurrence.Builder() .withInterval(10) .withUnit(RecurrenceIntervalUnit.DAY) .build(); Trigger trigger = new Trigger.Builder() .withRecurrence(recurrence) .withEndDate(new UntilEn... | @Override public void mapFormOnEntity(JobForm form, JobFormEntity entity) { Trigger trigger = form.getTrigger(); EndDate endDate = trigger.getEndDate(); JobSimpleTriggerEntity simpleTrigger = new JobSimpleTriggerEntity(); mapCommonTriggerFieldsOnEntity(form, simpleTrigger); IntervalRecurrence recurrence = (IntervalRecu... | JobSimpleTriggerMapper extends BaseTriggerMapper { @Override public void mapFormOnEntity(JobForm form, JobFormEntity entity) { Trigger trigger = form.getTrigger(); EndDate endDate = trigger.getEndDate(); JobSimpleTriggerEntity simpleTrigger = new JobSimpleTriggerEntity(); mapCommonTriggerFieldsOnEntity(form, simpleTrig... | JobSimpleTriggerMapper extends BaseTriggerMapper { @Override public void mapFormOnEntity(JobForm form, JobFormEntity entity) { Trigger trigger = form.getTrigger(); EndDate endDate = trigger.getEndDate(); JobSimpleTriggerEntity simpleTrigger = new JobSimpleTriggerEntity(); mapCommonTriggerFieldsOnEntity(form, simpleTrig... | JobSimpleTriggerMapper extends BaseTriggerMapper { @Override public void mapFormOnEntity(JobForm form, JobFormEntity entity) { Trigger trigger = form.getTrigger(); EndDate endDate = trigger.getEndDate(); JobSimpleTriggerEntity simpleTrigger = new JobSimpleTriggerEntity(); mapCommonTriggerFieldsOnEntity(form, simpleTrig... | JobSimpleTriggerMapper extends BaseTriggerMapper { @Override public void mapFormOnEntity(JobForm form, JobFormEntity entity) { Trigger trigger = form.getTrigger(); EndDate endDate = trigger.getEndDate(); JobSimpleTriggerEntity simpleTrigger = new JobSimpleTriggerEntity(); mapCommonTriggerFieldsOnEntity(form, simpleTrig... |
@Test public void should_map_simple_trigger_with_occurrence_count() throws Exception { JobSimpleTriggerEntity simpleTrigger = new JobSimpleTriggerEntity(); simpleTrigger.setOccurrenceCount(1); simpleTrigger.setRecurrenceIntervalUnit("DAY"); simpleTrigger.setCalendarName("Gregorian"); simpleTrigger.setRecurrenceInterval... | @Override public void mapEntityOnForm(JobForm.Builder form, JobFormEntity entity) { mapCommonEntityTriggerFieldsOnEntity(form, entity); JobSimpleTriggerEntity simpleTrigger = entity.getSimpleTrigger(); int occurrenceCount = simpleTrigger.getOccurrenceCount(); Integer recurrenceInterval = simpleTrigger.getRecurrenceInte... | JobSimpleTriggerMapper extends BaseTriggerMapper { @Override public void mapEntityOnForm(JobForm.Builder form, JobFormEntity entity) { mapCommonEntityTriggerFieldsOnEntity(form, entity); JobSimpleTriggerEntity simpleTrigger = entity.getSimpleTrigger(); int occurrenceCount = simpleTrigger.getOccurrenceCount(); Integer r... | JobSimpleTriggerMapper extends BaseTriggerMapper { @Override public void mapEntityOnForm(JobForm.Builder form, JobFormEntity entity) { mapCommonEntityTriggerFieldsOnEntity(form, entity); JobSimpleTriggerEntity simpleTrigger = entity.getSimpleTrigger(); int occurrenceCount = simpleTrigger.getOccurrenceCount(); Integer r... | JobSimpleTriggerMapper extends BaseTriggerMapper { @Override public void mapEntityOnForm(JobForm.Builder form, JobFormEntity entity) { mapCommonEntityTriggerFieldsOnEntity(form, entity); JobSimpleTriggerEntity simpleTrigger = entity.getSimpleTrigger(); int occurrenceCount = simpleTrigger.getOccurrenceCount(); Integer r... | JobSimpleTriggerMapper extends BaseTriggerMapper { @Override public void mapEntityOnForm(JobForm.Builder form, JobFormEntity entity) { mapCommonEntityTriggerFieldsOnEntity(form, entity); JobSimpleTriggerEntity simpleTrigger = entity.getSimpleTrigger(); int occurrenceCount = simpleTrigger.getOccurrenceCount(); Integer r... |
@Test public void should_map_simple_trigger_with_end_date() throws Exception { JobSimpleTriggerEntity simpleTrigger = new JobSimpleTriggerEntity(); simpleTrigger.setOccurrenceCount(-1); simpleTrigger.setRecurrenceInterval(1); simpleTrigger.setRecurrenceIntervalUnit("DAY"); simpleTrigger.setEndDate(formFactory.provideEn... | @Override public void mapEntityOnForm(JobForm.Builder form, JobFormEntity entity) { mapCommonEntityTriggerFieldsOnEntity(form, entity); JobSimpleTriggerEntity simpleTrigger = entity.getSimpleTrigger(); int occurrenceCount = simpleTrigger.getOccurrenceCount(); Integer recurrenceInterval = simpleTrigger.getRecurrenceInte... | JobSimpleTriggerMapper extends BaseTriggerMapper { @Override public void mapEntityOnForm(JobForm.Builder form, JobFormEntity entity) { mapCommonEntityTriggerFieldsOnEntity(form, entity); JobSimpleTriggerEntity simpleTrigger = entity.getSimpleTrigger(); int occurrenceCount = simpleTrigger.getOccurrenceCount(); Integer r... | JobSimpleTriggerMapper extends BaseTriggerMapper { @Override public void mapEntityOnForm(JobForm.Builder form, JobFormEntity entity) { mapCommonEntityTriggerFieldsOnEntity(form, entity); JobSimpleTriggerEntity simpleTrigger = entity.getSimpleTrigger(); int occurrenceCount = simpleTrigger.getOccurrenceCount(); Integer r... | JobSimpleTriggerMapper extends BaseTriggerMapper { @Override public void mapEntityOnForm(JobForm.Builder form, JobFormEntity entity) { mapCommonEntityTriggerFieldsOnEntity(form, entity); JobSimpleTriggerEntity simpleTrigger = entity.getSimpleTrigger(); int occurrenceCount = simpleTrigger.getOccurrenceCount(); Integer r... | JobSimpleTriggerMapper extends BaseTriggerMapper { @Override public void mapEntityOnForm(JobForm.Builder form, JobFormEntity entity) { mapCommonEntityTriggerFieldsOnEntity(form, entity); JobSimpleTriggerEntity simpleTrigger = entity.getSimpleTrigger(); int occurrenceCount = simpleTrigger.getOccurrenceCount(); Integer r... |
@Test public void should_parse_without_milliseconds() throws Exception { parser.parseDate(PREVIOUS_FIRE_TIME); } | @Nullable abstract Date parseDate(String rawDate); | JobUnitDateParser { @Nullable abstract Date parseDate(String rawDate); } | JobUnitDateParser { @Nullable abstract Date parseDate(String rawDate); } | JobUnitDateParser { @Nullable abstract Date parseDate(String rawDate); } | JobUnitDateParser { @Nullable abstract Date parseDate(String rawDate); } |
@Test public void should_parse_with_milliseconds() throws Exception { parser.parseDate(NEXT_FIRE_TIME); } | @Nullable abstract Date parseDate(String rawDate); | JobUnitDateParser { @Nullable abstract Date parseDate(String rawDate); } | JobUnitDateParser { @Nullable abstract Date parseDate(String rawDate); } | JobUnitDateParser { @Nullable abstract Date parseDate(String rawDate); } | JobUnitDateParser { @Nullable abstract Date parseDate(String rawDate); } |
@Test public void testCreate() throws Exception { when(mExportDescriptor.getId()).thenReturn(EXPORT_ID); when(mAttachmentDescriptor.getFileName()).thenReturn(ATTACHMENT_ID); when(mExportDescriptor.getAttachments()).thenReturn(Collections.singleton(mAttachmentDescriptor)); List<ReportAttachment> result = attachmentsFact... | public List<ReportAttachment> create(ExportDescriptor export, String execId) { String exportId = export.getId(); Set<AttachmentDescriptor> rawAttachments = export.getAttachments(); List<ReportAttachment> attachments = new ArrayList<>(rawAttachments.size()); for (AttachmentDescriptor attachment : rawAttachments) { Strin... | AttachmentsFactory { public List<ReportAttachment> create(ExportDescriptor export, String execId) { String exportId = export.getId(); Set<AttachmentDescriptor> rawAttachments = export.getAttachments(); List<ReportAttachment> attachments = new ArrayList<>(rawAttachments.size()); for (AttachmentDescriptor attachment : ra... | AttachmentsFactory { public List<ReportAttachment> create(ExportDescriptor export, String execId) { String exportId = export.getId(); Set<AttachmentDescriptor> rawAttachments = export.getAttachments(); List<ReportAttachment> attachments = new ArrayList<>(rawAttachments.size()); for (AttachmentDescriptor attachment : ra... | AttachmentsFactory { public List<ReportAttachment> create(ExportDescriptor export, String execId) { String exportId = export.getId(); Set<AttachmentDescriptor> rawAttachments = export.getAttachments(); List<ReportAttachment> attachments = new ArrayList<>(rawAttachments.size()); for (AttachmentDescriptor attachment : ra... | AttachmentsFactory { public List<ReportAttachment> create(ExportDescriptor export, String execId) { String exportId = export.getId(); Set<AttachmentDescriptor> rawAttachments = export.getAttachments(); List<ReportAttachment> attachments = new ArrayList<>(rawAttachments.size()); for (AttachmentDescriptor attachment : ra... |
@Test public void testStart() throws Exception { when(mExportOptionsMapper.transform(any(ReportExportOptions.class))).thenReturn(mExecutionRequestOptions); ReportExportOptions criteria = FakeOptions.export(); exportExecutionApi.start(EXEC_ID, criteria); verify(mReportExportRestApi).runExportExecution(EXEC_ID, mExecutio... | public ExportExecutionDescriptor start(String execId, ReportExportOptions reportExportOptions) throws ServiceException { ExecutionRequestOptions options = mExportOptionsMapper.transform(reportExportOptions); try { return mReportExportRestApi.runExportExecution(execId, options); } catch (HttpException e) { throw mExcept... | ExportExecutionApi { public ExportExecutionDescriptor start(String execId, ReportExportOptions reportExportOptions) throws ServiceException { ExecutionRequestOptions options = mExportOptionsMapper.transform(reportExportOptions); try { return mReportExportRestApi.runExportExecution(execId, options); } catch (HttpExcepti... | ExportExecutionApi { public ExportExecutionDescriptor start(String execId, ReportExportOptions reportExportOptions) throws ServiceException { ExecutionRequestOptions options = mExportOptionsMapper.transform(reportExportOptions); try { return mReportExportRestApi.runExportExecution(execId, options); } catch (HttpExcepti... | ExportExecutionApi { public ExportExecutionDescriptor start(String execId, ReportExportOptions reportExportOptions) throws ServiceException { ExecutionRequestOptions options = mExportOptionsMapper.transform(reportExportOptions); try { return mReportExportRestApi.runExportExecution(execId, options); } catch (HttpExcepti... | ExportExecutionApi { public ExportExecutionDescriptor start(String execId, ReportExportOptions reportExportOptions) throws ServiceException { ExecutionRequestOptions options = mExportOptionsMapper.transform(reportExportOptions); try { return mReportExportRestApi.runExportExecution(execId, options); } catch (HttpExcepti... |
@Test public void testDownloadExport() throws Exception { when(mReportExportRestApi.requestExportOutput(anyString(), anyString())).thenReturn(export); exportExecutionApi.downloadExport(EXEC_ID, EXPORT_ID); verify(mReportExportRestApi).requestExportOutput(EXEC_ID, EXPORT_ID); verify(mReportExportMapper).transform(export... | public ReportExportOutput downloadExport(String execId, String exportId) throws ServiceException { try { ExportOutputResource result = mReportExportRestApi.requestExportOutput(execId, exportId); return mReportExportMapper.transform(result); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catch (IOExc... | ExportExecutionApi { public ReportExportOutput downloadExport(String execId, String exportId) throws ServiceException { try { ExportOutputResource result = mReportExportRestApi.requestExportOutput(execId, exportId); return mReportExportMapper.transform(result); } catch (HttpException e) { throw mExceptionMapper.transfo... | ExportExecutionApi { public ReportExportOutput downloadExport(String execId, String exportId) throws ServiceException { try { ExportOutputResource result = mReportExportRestApi.requestExportOutput(execId, exportId); return mReportExportMapper.transform(result); } catch (HttpException e) { throw mExceptionMapper.transfo... | ExportExecutionApi { public ReportExportOutput downloadExport(String execId, String exportId) throws ServiceException { try { ExportOutputResource result = mReportExportRestApi.requestExportOutput(execId, exportId); return mReportExportMapper.transform(result); } catch (HttpException e) { throw mExceptionMapper.transfo... | ExportExecutionApi { public ReportExportOutput downloadExport(String execId, String exportId) throws ServiceException { try { ExportOutputResource result = mReportExportRestApi.requestExportOutput(execId, exportId); return mReportExportMapper.transform(result); } catch (HttpException e) { throw mExceptionMapper.transfo... |
@Test public void testDownloadAttachment() throws Exception { when(mReportExportRestApi.requestExportAttachment(anyString(), anyString(), anyString())).thenReturn(attachment); exportExecutionApi.downloadAttachment(EXEC_ID, EXPORT_ID, ATTACHMENT_ID); verify(mReportExportRestApi).requestExportAttachment(EXEC_ID, EXPORT_I... | public ResourceOutput downloadAttachment(String execId, String exportId, String attachmentId) throws ServiceException { try { OutputResource result = mReportExportRestApi.requestExportAttachment(execId, exportId, attachmentId); return mAttachmentExportMapper.transform(result); } catch (HttpException e) { throw mExcepti... | ExportExecutionApi { public ResourceOutput downloadAttachment(String execId, String exportId, String attachmentId) throws ServiceException { try { OutputResource result = mReportExportRestApi.requestExportAttachment(execId, exportId, attachmentId); return mAttachmentExportMapper.transform(result); } catch (HttpExceptio... | ExportExecutionApi { public ResourceOutput downloadAttachment(String execId, String exportId, String attachmentId) throws ServiceException { try { OutputResource result = mReportExportRestApi.requestExportAttachment(execId, exportId, attachmentId); return mAttachmentExportMapper.transform(result); } catch (HttpExceptio... | ExportExecutionApi { public ResourceOutput downloadAttachment(String execId, String exportId, String attachmentId) throws ServiceException { try { OutputResource result = mReportExportRestApi.requestExportAttachment(execId, exportId, attachmentId); return mAttachmentExportMapper.transform(result); } catch (HttpExceptio... | ExportExecutionApi { public ResourceOutput downloadAttachment(String execId, String exportId, String attachmentId) throws ServiceException { try { OutputResource result = mReportExportRestApi.requestExportAttachment(execId, exportId, attachmentId); return mAttachmentExportMapper.transform(result); } catch (HttpExceptio... |
@Test public void should_create_export_if_details_fulfilled() throws Exception { ReportExport result = exportFactory.create(mReportExecutionDescriptor, EXEC_ID, mExportIdWrapper); assertThat(result, is(notNullValue())); assertThat(result, is(instanceOf(ReportExport.class))); verify(mAttachmentsFactory).create(mExportDe... | @NotNull public ReportExport create(ReportExecutionDescriptor descriptor, String execId, ExportIdWrapper exportIdWrapper) throws ServiceException { ExportDescriptor export = findExportDescriptor(descriptor, exportIdWrapper.getServerId()); if (export == null) { throw new ServiceException("Server returned malformed expor... | ExportFactory { @NotNull public ReportExport create(ReportExecutionDescriptor descriptor, String execId, ExportIdWrapper exportIdWrapper) throws ServiceException { ExportDescriptor export = findExportDescriptor(descriptor, exportIdWrapper.getServerId()); if (export == null) { throw new ServiceException("Server returned... | ExportFactory { @NotNull public ReportExport create(ReportExecutionDescriptor descriptor, String execId, ExportIdWrapper exportIdWrapper) throws ServiceException { ExportDescriptor export = findExportDescriptor(descriptor, exportIdWrapper.getServerId()); if (export == null) { throw new ServiceException("Server returned... | ExportFactory { @NotNull public ReportExport create(ReportExecutionDescriptor descriptor, String execId, ExportIdWrapper exportIdWrapper) throws ServiceException { ExportDescriptor export = findExportDescriptor(descriptor, exportIdWrapper.getServerId()); if (export == null) { throw new ServiceException("Server returned... | ExportFactory { @NotNull public ReportExport create(ReportExecutionDescriptor descriptor, String execId, ExportIdWrapper exportIdWrapper) throws ServiceException { ExportDescriptor export = findExportDescriptor(descriptor, exportIdWrapper.getServerId()); if (export == null) { throw new ServiceException("Server returned... |
@Test public void requestInputControlsShouldNotAllowNullReportUri() throws Exception { mExpectedException.expect(NullPointerException.class); mExpectedException.expectMessage("Report URI should not be null"); restApiUnderTest.requestInputControls(null, null, false); } | @NotNull public List<InputControl> requestInputControls(@NotNull String reportUri, @Nullable Set<String> controlIds, boolean excludeState) throws IOException, HttpException { Utils.checkNotNull(reportUri, "Report URI should not be null"); String ids = ""; if (controlIds != null && !controlIds.isEmpty()) { ids = Utils.j... | InputControlRestApi { @NotNull public List<InputControl> requestInputControls(@NotNull String reportUri, @Nullable Set<String> controlIds, boolean excludeState) throws IOException, HttpException { Utils.checkNotNull(reportUri, "Report URI should not be null"); String ids = ""; if (controlIds != null && !controlIds.isEm... | InputControlRestApi { @NotNull public List<InputControl> requestInputControls(@NotNull String reportUri, @Nullable Set<String> controlIds, boolean excludeState) throws IOException, HttpException { Utils.checkNotNull(reportUri, "Report URI should not be null"); String ids = ""; if (controlIds != null && !controlIds.isEm... | InputControlRestApi { @NotNull public List<InputControl> requestInputControls(@NotNull String reportUri, @Nullable Set<String> controlIds, boolean excludeState) throws IOException, HttpException { Utils.checkNotNull(reportUri, "Report URI should not be null"); String ids = ""; if (controlIds != null && !controlIds.isEm... | InputControlRestApi { @NotNull public List<InputControl> requestInputControls(@NotNull String reportUri, @Nullable Set<String> controlIds, boolean excludeState) throws IOException, HttpException { Utils.checkNotNull(reportUri, "Report URI should not be null"); String ids = ""; if (controlIds != null && !controlIds.isEm... |
@Test public void should_throw_if_details_missing() throws Exception { when(mExportDescriptor.getId()).thenReturn("123122"); try { exportFactory.create(mReportExecutionDescriptor, EXEC_ID, mExportIdWrapper); fail("Should throw ServiceException"); } catch (ServiceException ex) { assertThat(ex.getMessage(), is("Server re... | @NotNull public ReportExport create(ReportExecutionDescriptor descriptor, String execId, ExportIdWrapper exportIdWrapper) throws ServiceException { ExportDescriptor export = findExportDescriptor(descriptor, exportIdWrapper.getServerId()); if (export == null) { throw new ServiceException("Server returned malformed expor... | ExportFactory { @NotNull public ReportExport create(ReportExecutionDescriptor descriptor, String execId, ExportIdWrapper exportIdWrapper) throws ServiceException { ExportDescriptor export = findExportDescriptor(descriptor, exportIdWrapper.getServerId()); if (export == null) { throw new ServiceException("Server returned... | ExportFactory { @NotNull public ReportExport create(ReportExecutionDescriptor descriptor, String execId, ExportIdWrapper exportIdWrapper) throws ServiceException { ExportDescriptor export = findExportDescriptor(descriptor, exportIdWrapper.getServerId()); if (export == null) { throw new ServiceException("Server returned... | ExportFactory { @NotNull public ReportExport create(ReportExecutionDescriptor descriptor, String execId, ExportIdWrapper exportIdWrapper) throws ServiceException { ExportDescriptor export = findExportDescriptor(descriptor, exportIdWrapper.getServerId()); if (export == null) { throw new ServiceException("Server returned... | ExportFactory { @NotNull public ReportExport create(ReportExecutionDescriptor descriptor, String execId, ExportIdWrapper exportIdWrapper) throws ServiceException { ExportDescriptor export = findExportDescriptor(descriptor, exportIdWrapper.getServerId()); if (export == null) { throw new ServiceException("Server returned... |
@Test public void testWaitForReportCompletion() throws Exception { ReportMetadata metadata = abstractReportExecution.waitForReportCompletion(); assertThat("Failed to create report metadata with exact total pages", metadata.getUri(), is(REPORT_URI)); assertThat("Failed to create report metadata with exact report uri", m... | @NotNull @Override public final ReportMetadata waitForReportCompletion() throws ServiceException { mReportExecutionApi.awaitStatus(mExecId, mReportUri, mDelay, Status.ready()); ReportExecutionDescriptor reportDescriptor = mReportExecutionApi.getDetails(mExecId); return new ReportMetadata(mReportUri, reportDescriptor.ge... | AbstractReportExecution extends ReportExecution { @NotNull @Override public final ReportMetadata waitForReportCompletion() throws ServiceException { mReportExecutionApi.awaitStatus(mExecId, mReportUri, mDelay, Status.ready()); ReportExecutionDescriptor reportDescriptor = mReportExecutionApi.getDetails(mExecId); return ... | AbstractReportExecution extends ReportExecution { @NotNull @Override public final ReportMetadata waitForReportCompletion() throws ServiceException { mReportExecutionApi.awaitStatus(mExecId, mReportUri, mDelay, Status.ready()); ReportExecutionDescriptor reportDescriptor = mReportExecutionApi.getDetails(mExecId); return ... | AbstractReportExecution extends ReportExecution { @NotNull @Override public final ReportMetadata waitForReportCompletion() throws ServiceException { mReportExecutionApi.awaitStatus(mExecId, mReportUri, mDelay, Status.ready()); ReportExecutionDescriptor reportDescriptor = mReportExecutionApi.getDetails(mExecId); return ... | AbstractReportExecution extends ReportExecution { @NotNull @Override public final ReportMetadata waitForReportCompletion() throws ServiceException { mReportExecutionApi.awaitStatus(mExecId, mReportUri, mDelay, Status.ready()); ReportExecutionDescriptor reportDescriptor = mReportExecutionApi.getDetails(mExecId); return ... |
@Test public void should_not_run_export_with_null_options() throws Exception { expected.expect(NullPointerException.class); expected.expectMessage("Export options should not be null"); abstractReportExecution.export(null); } | @NotNull @Override public final ReportExport export(@NotNull ReportExportOptions options) throws ServiceException { Preconditions.checkNotNull(options, "Export options should not be null"); return doExport(options); } | AbstractReportExecution extends ReportExecution { @NotNull @Override public final ReportExport export(@NotNull ReportExportOptions options) throws ServiceException { Preconditions.checkNotNull(options, "Export options should not be null"); return doExport(options); } } | AbstractReportExecution extends ReportExecution { @NotNull @Override public final ReportExport export(@NotNull ReportExportOptions options) throws ServiceException { Preconditions.checkNotNull(options, "Export options should not be null"); return doExport(options); } protected AbstractReportExecution(ReportExecutionAp... | AbstractReportExecution extends ReportExecution { @NotNull @Override public final ReportExport export(@NotNull ReportExportOptions options) throws ServiceException { Preconditions.checkNotNull(options, "Export options should not be null"); return doExport(options); } protected AbstractReportExecution(ReportExecutionAp... | AbstractReportExecution extends ReportExecution { @NotNull @Override public final ReportExport export(@NotNull ReportExportOptions options) throws ServiceException { Preconditions.checkNotNull(options, "Export options should not be null"); return doExport(options); } protected AbstractReportExecution(ReportExecutionAp... |
@Test public void should_exclude_ignore_pagination_flag() throws Exception { ReportExportOptions criteria = ReportExportOptions.builder() .withFormat(ReportFormat.PDF) .withIgnorePagination(true) .build(); ExecutionRequestOptions options = mapper.transform(criteria); assertThat("Failed to remove 'ignorePagination' opti... | @Override public ExecutionRequestOptions transform(ReportExportOptions criteria) { ExecutionRequestOptions options = super.transform(criteria); options.withIgnorePagination(null); options.withBaseUrl(null); options.withMarkupType(null); return options; } | ExportOptionsMapper5_5 extends ExportOptionsMapper { @Override public ExecutionRequestOptions transform(ReportExportOptions criteria) { ExecutionRequestOptions options = super.transform(criteria); options.withIgnorePagination(null); options.withBaseUrl(null); options.withMarkupType(null); return options; } } | ExportOptionsMapper5_5 extends ExportOptionsMapper { @Override public ExecutionRequestOptions transform(ReportExportOptions criteria) { ExecutionRequestOptions options = super.transform(criteria); options.withIgnorePagination(null); options.withBaseUrl(null); options.withMarkupType(null); return options; } ExportOption... | ExportOptionsMapper5_5 extends ExportOptionsMapper { @Override public ExecutionRequestOptions transform(ReportExportOptions criteria) { ExecutionRequestOptions options = super.transform(criteria); options.withIgnorePagination(null); options.withBaseUrl(null); options.withMarkupType(null); return options; } ExportOption... | ExportOptionsMapper5_5 extends ExportOptionsMapper { @Override public ExecutionRequestOptions transform(ReportExportOptions criteria) { ExecutionRequestOptions options = super.transform(criteria); options.withIgnorePagination(null); options.withBaseUrl(null); options.withMarkupType(null); return options; } ExportOption... |
@Test public void should_exclude_base_url() throws Exception { ReportExportOptions criteria = ReportExportOptions.builder() .withFormat(ReportFormat.PDF) .withIgnorePagination(true) .build(); ExecutionRequestOptions options = mapper.transform(criteria); assertThat("Failed to remove 'baseUrl' option", options.getBaseUrl... | @Override public ExecutionRequestOptions transform(ReportExportOptions criteria) { ExecutionRequestOptions options = super.transform(criteria); options.withIgnorePagination(null); options.withBaseUrl(null); options.withMarkupType(null); return options; } | ExportOptionsMapper5_5 extends ExportOptionsMapper { @Override public ExecutionRequestOptions transform(ReportExportOptions criteria) { ExecutionRequestOptions options = super.transform(criteria); options.withIgnorePagination(null); options.withBaseUrl(null); options.withMarkupType(null); return options; } } | ExportOptionsMapper5_5 extends ExportOptionsMapper { @Override public ExecutionRequestOptions transform(ReportExportOptions criteria) { ExecutionRequestOptions options = super.transform(criteria); options.withIgnorePagination(null); options.withBaseUrl(null); options.withMarkupType(null); return options; } ExportOption... | ExportOptionsMapper5_5 extends ExportOptionsMapper { @Override public ExecutionRequestOptions transform(ReportExportOptions criteria) { ExecutionRequestOptions options = super.transform(criteria); options.withIgnorePagination(null); options.withBaseUrl(null); options.withMarkupType(null); return options; } ExportOption... | ExportOptionsMapper5_5 extends ExportOptionsMapper { @Override public ExecutionRequestOptions transform(ReportExportOptions criteria) { ExecutionRequestOptions options = super.transform(criteria); options.withIgnorePagination(null); options.withBaseUrl(null); options.withMarkupType(null); return options; } ExportOption... |
@Test public void should_not_run_with_null_uri() throws Exception { expected.expect(NullPointerException.class); expected.expectMessage("Report uri should not be null"); proxyReportService.run(null, null); } | @NotNull @Override public ReportExecution run(@Nullable String reportUri, @Nullable ReportExecutionOptions execOptions) throws ServiceException { Preconditions.checkNotNull(reportUri, "Report uri should not be null"); if (execOptions == null) { execOptions = ReportExecutionOptions.builder().build(); } return getDelegat... | ProxyReportService extends ReportService { @NotNull @Override public ReportExecution run(@Nullable String reportUri, @Nullable ReportExecutionOptions execOptions) throws ServiceException { Preconditions.checkNotNull(reportUri, "Report uri should not be null"); if (execOptions == null) { execOptions = ReportExecutionOpt... | ProxyReportService extends ReportService { @NotNull @Override public ReportExecution run(@Nullable String reportUri, @Nullable ReportExecutionOptions execOptions) throws ServiceException { Preconditions.checkNotNull(reportUri, "Report uri should not be null"); if (execOptions == null) { execOptions = ReportExecutionOpt... | ProxyReportService extends ReportService { @NotNull @Override public ReportExecution run(@Nullable String reportUri, @Nullable ReportExecutionOptions execOptions) throws ServiceException { Preconditions.checkNotNull(reportUri, "Report uri should not be null"); if (execOptions == null) { execOptions = ReportExecutionOpt... | ProxyReportService extends ReportService { @NotNull @Override public ReportExecution run(@Nullable String reportUri, @Nullable ReportExecutionOptions execOptions) throws ServiceException { Preconditions.checkNotNull(reportUri, "Report uri should not be null"); if (execOptions == null) { execOptions = ReportExecutionOpt... |
@Test public void should_delegate_run_call() throws Exception { proxyReportService.run(REPORT_URI, null); verify(mReportServiceFactory).newService(); verify(mReportService).run(eq(REPORT_URI), any(ReportExecutionOptions.class)); } | @NotNull @Override public ReportExecution run(@Nullable String reportUri, @Nullable ReportExecutionOptions execOptions) throws ServiceException { Preconditions.checkNotNull(reportUri, "Report uri should not be null"); if (execOptions == null) { execOptions = ReportExecutionOptions.builder().build(); } return getDelegat... | ProxyReportService extends ReportService { @NotNull @Override public ReportExecution run(@Nullable String reportUri, @Nullable ReportExecutionOptions execOptions) throws ServiceException { Preconditions.checkNotNull(reportUri, "Report uri should not be null"); if (execOptions == null) { execOptions = ReportExecutionOpt... | ProxyReportService extends ReportService { @NotNull @Override public ReportExecution run(@Nullable String reportUri, @Nullable ReportExecutionOptions execOptions) throws ServiceException { Preconditions.checkNotNull(reportUri, "Report uri should not be null"); if (execOptions == null) { execOptions = ReportExecutionOpt... | ProxyReportService extends ReportService { @NotNull @Override public ReportExecution run(@Nullable String reportUri, @Nullable ReportExecutionOptions execOptions) throws ServiceException { Preconditions.checkNotNull(reportUri, "Report uri should not be null"); if (execOptions == null) { execOptions = ReportExecutionOpt... | ProxyReportService extends ReportService { @NotNull @Override public ReportExecution run(@Nullable String reportUri, @Nullable ReportExecutionOptions execOptions) throws ServiceException { Preconditions.checkNotNull(reportUri, "Report uri should not be null"); if (execOptions == null) { execOptions = ReportExecutionOpt... |
@Test public void should_create_proxy_instance() throws Exception { ReportService service = ReportService.newService(mClient); assertThat("Should be instance of proxy service", service, is(instanceOf(ProxyReportService.class))); assertThat(service, is(notNullValue())); } | @NotNull public static ReportService newService(@NotNull AuthorizedClient client) { Preconditions.checkNotNull(client, "Client should not be null"); InfoCacheManager cacheManager = InfoCacheManager.create(client); ServiceExceptionMapper reportMapper = ReportExceptionMapper.getInstance(); ReportServiceFactory reportServ... | ReportService { @NotNull public static ReportService newService(@NotNull AuthorizedClient client) { Preconditions.checkNotNull(client, "Client should not be null"); InfoCacheManager cacheManager = InfoCacheManager.create(client); ServiceExceptionMapper reportMapper = ReportExceptionMapper.getInstance(); ReportServiceFa... | ReportService { @NotNull public static ReportService newService(@NotNull AuthorizedClient client) { Preconditions.checkNotNull(client, "Client should not be null"); InfoCacheManager cacheManager = InfoCacheManager.create(client); ServiceExceptionMapper reportMapper = ReportExceptionMapper.getInstance(); ReportServiceFa... | ReportService { @NotNull public static ReportService newService(@NotNull AuthorizedClient client) { Preconditions.checkNotNull(client, "Client should not be null"); InfoCacheManager cacheManager = InfoCacheManager.create(client); ServiceExceptionMapper reportMapper = ReportExceptionMapper.getInstance(); ReportServiceFa... | ReportService { @NotNull public static ReportService newService(@NotNull AuthorizedClient client) { Preconditions.checkNotNull(client, "Client should not be null"); InfoCacheManager cacheManager = InfoCacheManager.create(client); ServiceExceptionMapper reportMapper = ReportExceptionMapper.getInstance(); ReportServiceFa... |
@Test public void should_reject_null_client() throws Exception { expected.expectMessage("Client should not be null"); expected.expect(NullPointerException.class); ReportService.newService(null); } | @NotNull public static ReportService newService(@NotNull AuthorizedClient client) { Preconditions.checkNotNull(client, "Client should not be null"); InfoCacheManager cacheManager = InfoCacheManager.create(client); ServiceExceptionMapper reportMapper = ReportExceptionMapper.getInstance(); ReportServiceFactory reportServ... | ReportService { @NotNull public static ReportService newService(@NotNull AuthorizedClient client) { Preconditions.checkNotNull(client, "Client should not be null"); InfoCacheManager cacheManager = InfoCacheManager.create(client); ServiceExceptionMapper reportMapper = ReportExceptionMapper.getInstance(); ReportServiceFa... | ReportService { @NotNull public static ReportService newService(@NotNull AuthorizedClient client) { Preconditions.checkNotNull(client, "Client should not be null"); InfoCacheManager cacheManager = InfoCacheManager.create(client); ServiceExceptionMapper reportMapper = ReportExceptionMapper.getInstance(); ReportServiceFa... | ReportService { @NotNull public static ReportService newService(@NotNull AuthorizedClient client) { Preconditions.checkNotNull(client, "Client should not be null"); InfoCacheManager cacheManager = InfoCacheManager.create(client); ServiceExceptionMapper reportMapper = ReportExceptionMapper.getInstance(); ReportServiceFa... | ReportService { @NotNull public static ReportService newService(@NotNull AuthorizedClient client) { Preconditions.checkNotNull(client, "Client should not be null"); InfoCacheManager cacheManager = InfoCacheManager.create(client); ServiceExceptionMapper reportMapper = ReportExceptionMapper.getInstance(); ReportServiceFa... |
@Test public void testTransform() throws Exception { when(mExportOutputResource.getPages()).thenReturn(TOTAL_PAGES); when(mExportOutputResource.isFinal()).thenReturn(Boolean.FALSE); when(mOutput.getStream()).thenReturn(mStream); when(mExportOutputResource.getOutputResource()).thenReturn(mOutput); ReportExportOutput exp... | public ReportExportOutput transform(final ExportOutputResource outputResource) { return new ReportExportOutput() { @Override public boolean isFinal() { return outputResource.isFinal(); } @Override public PageRange getPages() { return PageRange.parse(outputResource.getPages()); } @Override public InputStream getStream()... | ReportExportMapper { public ReportExportOutput transform(final ExportOutputResource outputResource) { return new ReportExportOutput() { @Override public boolean isFinal() { return outputResource.isFinal(); } @Override public PageRange getPages() { return PageRange.parse(outputResource.getPages()); } @Override public In... | ReportExportMapper { public ReportExportOutput transform(final ExportOutputResource outputResource) { return new ReportExportOutput() { @Override public boolean isFinal() { return outputResource.isFinal(); } @Override public PageRange getPages() { return PageRange.parse(outputResource.getPages()); } @Override public In... | ReportExportMapper { public ReportExportOutput transform(final ExportOutputResource outputResource) { return new ReportExportOutput() { @Override public boolean isFinal() { return outputResource.isFinal(); } @Override public PageRange getPages() { return PageRange.parse(outputResource.getPages()); } @Override public In... | ReportExportMapper { public ReportExportOutput transform(final ExportOutputResource outputResource) { return new ReportExportOutput() { @Override public boolean isFinal() { return outputResource.isFinal(); } @Override public PageRange getPages() { return PageRange.parse(outputResource.getPages()); } @Override public In... |
@Test public void requestInputControlsStatesShouldNotAllowNullReportUri() throws Exception { mExpectedException.expect(NullPointerException.class); mExpectedException.expectMessage("Report URI should not be null"); restApiUnderTest.requestInputControlsStates(null, Collections.<ReportParameter>emptyList(), true); } | @NotNull public List<InputControlState> requestInputControlsStates(@NotNull String reportUri, @NotNull List<ReportParameter> parameters, boolean freshData) throws HttpException, IOException { Utils.checkNotNull(reportUri, "Report URI should not be null"); Utils.checkNotNull(parameters, "Parameters should not be null");... | InputControlRestApi { @NotNull public List<InputControlState> requestInputControlsStates(@NotNull String reportUri, @NotNull List<ReportParameter> parameters, boolean freshData) throws HttpException, IOException { Utils.checkNotNull(reportUri, "Report URI should not be null"); Utils.checkNotNull(parameters, "Parameters... | InputControlRestApi { @NotNull public List<InputControlState> requestInputControlsStates(@NotNull String reportUri, @NotNull List<ReportParameter> parameters, boolean freshData) throws HttpException, IOException { Utils.checkNotNull(reportUri, "Report URI should not be null"); Utils.checkNotNull(parameters, "Parameters... | InputControlRestApi { @NotNull public List<InputControlState> requestInputControlsStates(@NotNull String reportUri, @NotNull List<ReportParameter> parameters, boolean freshData) throws HttpException, IOException { Utils.checkNotNull(reportUri, "Report URI should not be null"); Utils.checkNotNull(parameters, "Parameters... | InputControlRestApi { @NotNull public List<InputControlState> requestInputControlsStates(@NotNull String reportUri, @NotNull List<ReportParameter> parameters, boolean freshData) throws HttpException, IOException { Utils.checkNotNull(reportUri, "Report URI should not be null"); Utils.checkNotNull(parameters, "Parameters... |
@Test public void should_generate_specific_exact_id_for_5_5() throws Exception { giveExportDetailsWithId(); givenExportForFirstHtmlPage(); givenConfigured5_5Wrapper(); String exactId = mWrapper5_5.getExactId(); assertThat(exactId, is("HTML;pages=1")); } | public abstract String getExactId(); | ExportIdWrapper { public abstract String getExactId(); } | ExportIdWrapper { public abstract String getExactId(); } | ExportIdWrapper { public abstract String getExactId(); abstract String getServerId(); abstract String getExactId(); final void wrap(ExportExecutionDescriptor exportDetails, ReportExportOptions options); } | ExportIdWrapper { public abstract String getExactId(); abstract String getServerId(); abstract String getExactId(); final void wrap(ExportExecutionDescriptor exportDetails, ReportExportOptions options); } |
@Test public void should_return_export_descriptor_id_for_5_5() throws Exception { giveExportDetailsWithId(); givenConfigured5_5Wrapper(); String serverId = mWrapper5_5.getServerId(); assertThat(serverId, is(EXPORT_ID)); } | public abstract String getServerId(); | ExportIdWrapper { public abstract String getServerId(); } | ExportIdWrapper { public abstract String getServerId(); } | ExportIdWrapper { public abstract String getServerId(); abstract String getServerId(); abstract String getExactId(); final void wrap(ExportExecutionDescriptor exportDetails, ReportExportOptions options); } | ExportIdWrapper { public abstract String getServerId(); abstract String getServerId(); abstract String getExactId(); final void wrap(ExportExecutionDescriptor exportDetails, ReportExportOptions options); } |
@Test public void should_generate_specific_exact_id_for_5_6Plus() throws Exception { giveExportDetailsWithId(); givenExportForFirstHtmlPage(); givenConfigured5_6PlusWrapper(); String exactId = mWrapper5_6Plus.getExactId(); assertThat(exactId, is(EXPORT_ID)); } | public abstract String getExactId(); | ExportIdWrapper { public abstract String getExactId(); } | ExportIdWrapper { public abstract String getExactId(); } | ExportIdWrapper { public abstract String getExactId(); abstract String getServerId(); abstract String getExactId(); final void wrap(ExportExecutionDescriptor exportDetails, ReportExportOptions options); } | ExportIdWrapper { public abstract String getExactId(); abstract String getServerId(); abstract String getExactId(); final void wrap(ExportExecutionDescriptor exportDetails, ReportExportOptions options); } |
@Test public void should_return_export_descriptor_id_for_5_6Plus() throws Exception { giveExportDetailsWithId(); givenConfigured5_6PlusWrapper(); String serverId = mWrapper5_6Plus.getServerId(); assertThat(serverId, is(EXPORT_ID)); } | public abstract String getServerId(); | ExportIdWrapper { public abstract String getServerId(); } | ExportIdWrapper { public abstract String getServerId(); } | ExportIdWrapper { public abstract String getServerId(); abstract String getServerId(); abstract String getExactId(); final void wrap(ExportExecutionDescriptor exportDetails, ReportExportOptions options); } | ExportIdWrapper { public abstract String getServerId(); abstract String getServerId(); abstract String getExactId(); final void wrap(ExportExecutionDescriptor exportDetails, ReportExportOptions options); } |
@Test public void should_retry_export_if_cancelled_on_first_run() throws Exception { when(mDelegate.export(any(ReportExportOptions.class))).then(crashOnFirstRun()); reportExecution.export(EXPORT_CRITERIA); verify(mDelegate, times(2)).export(EXPORT_CRITERIA); } | @NotNull @Override public ReportExport export(@NotNull ReportExportOptions options) throws ServiceException { try { return mDelegate.export(options); } catch (ServiceException ex) { boolean isCancelled = (ex.code() == StatusCodes.EXPORT_EXECUTION_CANCELLED || ex.code() == StatusCodes.REPORT_EXECUTION_CANCELLED); if (is... | RetryReportExecution extends ReportExecution { @NotNull @Override public ReportExport export(@NotNull ReportExportOptions options) throws ServiceException { try { return mDelegate.export(options); } catch (ServiceException ex) { boolean isCancelled = (ex.code() == StatusCodes.EXPORT_EXECUTION_CANCELLED || ex.code() == ... | RetryReportExecution extends ReportExecution { @NotNull @Override public ReportExport export(@NotNull ReportExportOptions options) throws ServiceException { try { return mDelegate.export(options); } catch (ServiceException ex) { boolean isCancelled = (ex.code() == StatusCodes.EXPORT_EXECUTION_CANCELLED || ex.code() == ... | RetryReportExecution extends ReportExecution { @NotNull @Override public ReportExport export(@NotNull ReportExportOptions options) throws ServiceException { try { return mDelegate.export(options); } catch (ServiceException ex) { boolean isCancelled = (ex.code() == StatusCodes.EXPORT_EXECUTION_CANCELLED || ex.code() == ... | RetryReportExecution extends ReportExecution { @NotNull @Override public ReportExport export(@NotNull ReportExportOptions options) throws ServiceException { try { return mDelegate.export(options); } catch (ServiceException ex) { boolean isCancelled = (ex.code() == StatusCodes.EXPORT_EXECUTION_CANCELLED || ex.code() == ... |
@Test(expected = ServiceException.class) public void should_throw_if_cancelled_on_second_run() throws Exception { when(mDelegate.export(any(ReportExportOptions.class))).thenThrow(CANCELLED_EXCEPTION); reportExecution.export(EXPORT_CRITERIA); } | @NotNull @Override public ReportExport export(@NotNull ReportExportOptions options) throws ServiceException { try { return mDelegate.export(options); } catch (ServiceException ex) { boolean isCancelled = (ex.code() == StatusCodes.EXPORT_EXECUTION_CANCELLED || ex.code() == StatusCodes.REPORT_EXECUTION_CANCELLED); if (is... | RetryReportExecution extends ReportExecution { @NotNull @Override public ReportExport export(@NotNull ReportExportOptions options) throws ServiceException { try { return mDelegate.export(options); } catch (ServiceException ex) { boolean isCancelled = (ex.code() == StatusCodes.EXPORT_EXECUTION_CANCELLED || ex.code() == ... | RetryReportExecution extends ReportExecution { @NotNull @Override public ReportExport export(@NotNull ReportExportOptions options) throws ServiceException { try { return mDelegate.export(options); } catch (ServiceException ex) { boolean isCancelled = (ex.code() == StatusCodes.EXPORT_EXECUTION_CANCELLED || ex.code() == ... | RetryReportExecution extends ReportExecution { @NotNull @Override public ReportExport export(@NotNull ReportExportOptions options) throws ServiceException { try { return mDelegate.export(options); } catch (ServiceException ex) { boolean isCancelled = (ex.code() == StatusCodes.EXPORT_EXECUTION_CANCELLED || ex.code() == ... | RetryReportExecution extends ReportExecution { @NotNull @Override public ReportExport export(@NotNull ReportExportOptions options) throws ServiceException { try { return mDelegate.export(options); } catch (ServiceException ex) { boolean isCancelled = (ex.code() == StatusCodes.EXPORT_EXECUTION_CANCELLED || ex.code() == ... |
@Test public void should_delegate_waitForReportCompletion() throws Exception { reportExecution.waitForReportCompletion(); verify(mDelegate).waitForReportCompletion(); } | @NotNull @Override public ReportMetadata waitForReportCompletion() throws ServiceException { return mDelegate.waitForReportCompletion(); } | RetryReportExecution extends ReportExecution { @NotNull @Override public ReportMetadata waitForReportCompletion() throws ServiceException { return mDelegate.waitForReportCompletion(); } } | RetryReportExecution extends ReportExecution { @NotNull @Override public ReportMetadata waitForReportCompletion() throws ServiceException { return mDelegate.waitForReportCompletion(); } RetryReportExecution(ReportExecution delegate); } | RetryReportExecution extends ReportExecution { @NotNull @Override public ReportMetadata waitForReportCompletion() throws ServiceException { return mDelegate.waitForReportCompletion(); } RetryReportExecution(ReportExecution delegate); @NotNull @Override ReportExport export(@NotNull ReportExportOptions options); @NotNull... | RetryReportExecution extends ReportExecution { @NotNull @Override public ReportMetadata waitForReportCompletion() throws ServiceException { return mDelegate.waitForReportCompletion(); } RetryReportExecution(ReportExecution delegate); @NotNull @Override ReportExport export(@NotNull ReportExportOptions options); @NotNull... |
@Test public void should_delegate_updateExecution() throws Exception { reportExecution.updateExecution(REPORT_PARAMS); verify(mDelegate).updateExecution(REPORT_PARAMS); } | @NotNull @Override public ReportExecution updateExecution(@Nullable List<ReportParameter> newParameters) throws ServiceException { return mDelegate.updateExecution(newParameters); } | RetryReportExecution extends ReportExecution { @NotNull @Override public ReportExecution updateExecution(@Nullable List<ReportParameter> newParameters) throws ServiceException { return mDelegate.updateExecution(newParameters); } } | RetryReportExecution extends ReportExecution { @NotNull @Override public ReportExecution updateExecution(@Nullable List<ReportParameter> newParameters) throws ServiceException { return mDelegate.updateExecution(newParameters); } RetryReportExecution(ReportExecution delegate); } | RetryReportExecution extends ReportExecution { @NotNull @Override public ReportExecution updateExecution(@Nullable List<ReportParameter> newParameters) throws ServiceException { return mDelegate.updateExecution(newParameters); } RetryReportExecution(ReportExecution delegate); @NotNull @Override ReportExport export(@Not... | RetryReportExecution extends ReportExecution { @NotNull @Override public ReportExecution updateExecution(@Nullable List<ReportParameter> newParameters) throws ServiceException { return mDelegate.updateExecution(newParameters); } RetryReportExecution(ReportExecution delegate); @NotNull @Override ReportExport export(@Not... |
@Test public void testRun() throws Exception { ReportExecutionOptions criteria = ReportExecutionOptions.builder().build(); reportService.run(REPORT_URI, criteria); verify(mReportExecutionApi).start(REPORT_URI, criteria); verify(mReportExecutionApi).awaitStatus(EXEC_ID, REPORT_URI, 0, execution(), ready()); verify(repor... | @NotNull @Override public final ReportExecution run(@NotNull String reportUri, @NotNull ReportExecutionOptions execOptions) throws ServiceException { ReportExecutionDescriptor descriptor = mReportExecutionApi.start(reportUri, execOptions); String executionId = descriptor.getExecutionId(); mReportExecutionApi.awaitStatu... | AbstractReportService extends ReportService { @NotNull @Override public final ReportExecution run(@NotNull String reportUri, @NotNull ReportExecutionOptions execOptions) throws ServiceException { ReportExecutionDescriptor descriptor = mReportExecutionApi.start(reportUri, execOptions); String executionId = descriptor.ge... | AbstractReportService extends ReportService { @NotNull @Override public final ReportExecution run(@NotNull String reportUri, @NotNull ReportExecutionOptions execOptions) throws ServiceException { ReportExecutionDescriptor descriptor = mReportExecutionApi.start(reportUri, execOptions); String executionId = descriptor.ge... | AbstractReportService extends ReportService { @NotNull @Override public final ReportExecution run(@NotNull String reportUri, @NotNull ReportExecutionOptions execOptions) throws ServiceException { ReportExecutionDescriptor descriptor = mReportExecutionApi.start(reportUri, execOptions); String executionId = descriptor.ge... | AbstractReportService extends ReportService { @NotNull @Override public final ReportExecution run(@NotNull String reportUri, @NotNull ReportExecutionOptions execOptions) throws ServiceException { ReportExecutionDescriptor descriptor = mReportExecutionApi.start(reportUri, execOptions); String executionId = descriptor.ge... |
@Test public void testTransform() throws Exception { when(mOutputResource.getStream()).thenReturn(mStream); ResourceOutput result = mapper.transform(mOutputResource); assertThat(result.getStream(), is(mStream)); } | public ResourceOutput transform(final OutputResource resource) { return new ResourceOutput() { @Override public InputStream getStream() throws IOException { return resource.getStream(); } }; } | AttachmentExportMapper { public ResourceOutput transform(final OutputResource resource) { return new ResourceOutput() { @Override public InputStream getStream() throws IOException { return resource.getStream(); } }; } } | AttachmentExportMapper { public ResourceOutput transform(final OutputResource resource) { return new ResourceOutput() { @Override public InputStream getStream() throws IOException { return resource.getStream(); } }; } } | AttachmentExportMapper { public ResourceOutput transform(final OutputResource resource) { return new ResourceOutput() { @Override public InputStream getStream() throws IOException { return resource.getStream(); } }; } ResourceOutput transform(final OutputResource resource); } | AttachmentExportMapper { public ResourceOutput transform(final OutputResource resource) { return new ResourceOutput() { @Override public InputStream getStream() throws IOException { return resource.getStream(); } }; } ResourceOutput transform(final OutputResource resource); } |
@Test public void requestInputControlsStatesShouldNotAllowNullControlParams() throws Exception { mExpectedException.expect(NullPointerException.class); mExpectedException.expectMessage("Parameters should not be null"); restApiUnderTest.requestInputControlsStates("any_id", null, true); } | @NotNull public List<InputControlState> requestInputControlsStates(@NotNull String reportUri, @NotNull List<ReportParameter> parameters, boolean freshData) throws HttpException, IOException { Utils.checkNotNull(reportUri, "Report URI should not be null"); Utils.checkNotNull(parameters, "Parameters should not be null");... | InputControlRestApi { @NotNull public List<InputControlState> requestInputControlsStates(@NotNull String reportUri, @NotNull List<ReportParameter> parameters, boolean freshData) throws HttpException, IOException { Utils.checkNotNull(reportUri, "Report URI should not be null"); Utils.checkNotNull(parameters, "Parameters... | InputControlRestApi { @NotNull public List<InputControlState> requestInputControlsStates(@NotNull String reportUri, @NotNull List<ReportParameter> parameters, boolean freshData) throws HttpException, IOException { Utils.checkNotNull(reportUri, "Report URI should not be null"); Utils.checkNotNull(parameters, "Parameters... | InputControlRestApi { @NotNull public List<InputControlState> requestInputControlsStates(@NotNull String reportUri, @NotNull List<ReportParameter> parameters, boolean freshData) throws HttpException, IOException { Utils.checkNotNull(reportUri, "Report URI should not be null"); Utils.checkNotNull(parameters, "Parameters... | InputControlRestApi { @NotNull public List<InputControlState> requestInputControlsStates(@NotNull String reportUri, @NotNull List<ReportParameter> parameters, boolean freshData) throws HttpException, IOException { Utils.checkNotNull(reportUri, "Report URI should not be null"); Utils.checkNotNull(parameters, "Parameters... |
@Test public void requestInputControlsShouldThrowRestErrorFor500() throws Exception { mExpectedException.expect(HttpException.class); mWebMockRule.enqueue(MockResponseFactory.create500()); restApiUnderTest.requestInputControls("any_id", null, true); } | @NotNull public List<InputControl> requestInputControls(@NotNull String reportUri, @Nullable Set<String> controlIds, boolean excludeState) throws IOException, HttpException { Utils.checkNotNull(reportUri, "Report URI should not be null"); String ids = ""; if (controlIds != null && !controlIds.isEmpty()) { ids = Utils.j... | InputControlRestApi { @NotNull public List<InputControl> requestInputControls(@NotNull String reportUri, @Nullable Set<String> controlIds, boolean excludeState) throws IOException, HttpException { Utils.checkNotNull(reportUri, "Report URI should not be null"); String ids = ""; if (controlIds != null && !controlIds.isEm... | InputControlRestApi { @NotNull public List<InputControl> requestInputControls(@NotNull String reportUri, @Nullable Set<String> controlIds, boolean excludeState) throws IOException, HttpException { Utils.checkNotNull(reportUri, "Report URI should not be null"); String ids = ""; if (controlIds != null && !controlIds.isEm... | InputControlRestApi { @NotNull public List<InputControl> requestInputControls(@NotNull String reportUri, @Nullable Set<String> controlIds, boolean excludeState) throws IOException, HttpException { Utils.checkNotNull(reportUri, "Report URI should not be null"); String ids = ""; if (controlIds != null && !controlIds.isEm... | InputControlRestApi { @NotNull public List<InputControl> requestInputControls(@NotNull String reportUri, @Nullable Set<String> controlIds, boolean excludeState) throws IOException, HttpException { Utils.checkNotNull(reportUri, "Report URI should not be null"); String ids = ""; if (controlIds != null && !controlIds.isEm... |
@Test public void requestInputControlsInitialStatesShouldThrowRestErrorFor500() throws Exception { mExpectedException.expect(HttpException.class); mWebMockRule.enqueue(MockResponseFactory.create500()); restApiUnderTest.requestInputControlsInitialStates("any_id", true); } | @NotNull public List<InputControlState> requestInputControlsInitialStates(@NotNull String reportUri, boolean freshData) throws IOException, HttpException { Utils.checkNotNull(reportUri, "Report URI should not be null"); HttpUrl url = new PathResolver.Builder() .addPath("rest_v2") .addPath("reports") .addPaths(reportUri... | InputControlRestApi { @NotNull public List<InputControlState> requestInputControlsInitialStates(@NotNull String reportUri, boolean freshData) throws IOException, HttpException { Utils.checkNotNull(reportUri, "Report URI should not be null"); HttpUrl url = new PathResolver.Builder() .addPath("rest_v2") .addPath("reports... | InputControlRestApi { @NotNull public List<InputControlState> requestInputControlsInitialStates(@NotNull String reportUri, boolean freshData) throws IOException, HttpException { Utils.checkNotNull(reportUri, "Report URI should not be null"); HttpUrl url = new PathResolver.Builder() .addPath("rest_v2") .addPath("reports... | InputControlRestApi { @NotNull public List<InputControlState> requestInputControlsInitialStates(@NotNull String reportUri, boolean freshData) throws IOException, HttpException { Utils.checkNotNull(reportUri, "Report URI should not be null"); HttpUrl url = new PathResolver.Builder() .addPath("rest_v2") .addPath("reports... | InputControlRestApi { @NotNull public List<InputControlState> requestInputControlsInitialStates(@NotNull String reportUri, boolean freshData) throws IOException, HttpException { Utils.checkNotNull(reportUri, "Report URI should not be null"); HttpUrl url = new PathResolver.Builder() .addPath("rest_v2") .addPath("reports... |
@Test public void requestInputControlsStatesShouldThrowRestErrorFor500() throws Exception { mExpectedException.expect(HttpException.class); mWebMockRule.enqueue(MockResponseFactory.create500()); restApiUnderTest.requestInputControlsStates("any_id", Collections.<ReportParameter>emptyList(), true); } | @NotNull public List<InputControlState> requestInputControlsStates(@NotNull String reportUri, @NotNull List<ReportParameter> parameters, boolean freshData) throws HttpException, IOException { Utils.checkNotNull(reportUri, "Report URI should not be null"); Utils.checkNotNull(parameters, "Parameters should not be null");... | InputControlRestApi { @NotNull public List<InputControlState> requestInputControlsStates(@NotNull String reportUri, @NotNull List<ReportParameter> parameters, boolean freshData) throws HttpException, IOException { Utils.checkNotNull(reportUri, "Report URI should not be null"); Utils.checkNotNull(parameters, "Parameters... | InputControlRestApi { @NotNull public List<InputControlState> requestInputControlsStates(@NotNull String reportUri, @NotNull List<ReportParameter> parameters, boolean freshData) throws HttpException, IOException { Utils.checkNotNull(reportUri, "Report URI should not be null"); Utils.checkNotNull(parameters, "Parameters... | InputControlRestApi { @NotNull public List<InputControlState> requestInputControlsStates(@NotNull String reportUri, @NotNull List<ReportParameter> parameters, boolean freshData) throws HttpException, IOException { Utils.checkNotNull(reportUri, "Report URI should not be null"); Utils.checkNotNull(parameters, "Parameters... | InputControlRestApi { @NotNull public List<InputControlState> requestInputControlsStates(@NotNull String reportUri, @NotNull List<ReportParameter> parameters, boolean freshData) throws HttpException, IOException { Utils.checkNotNull(reportUri, "Report URI should not be null"); Utils.checkNotNull(parameters, "Parameters... |
@Test public void apiShouldProvideListOfInputControlsInitialStatesWithFreshData() throws Exception { MockResponse mockResponse = MockResponseFactory.create200() .setBody(icsStates.asString()); mWebMockRule.enqueue(mockResponse); Collection<InputControlState> states = restApiUnderTest.requestInputControlsInitialStates("... | @NotNull public List<InputControlState> requestInputControlsInitialStates(@NotNull String reportUri, boolean freshData) throws IOException, HttpException { Utils.checkNotNull(reportUri, "Report URI should not be null"); HttpUrl url = new PathResolver.Builder() .addPath("rest_v2") .addPath("reports") .addPaths(reportUri... | InputControlRestApi { @NotNull public List<InputControlState> requestInputControlsInitialStates(@NotNull String reportUri, boolean freshData) throws IOException, HttpException { Utils.checkNotNull(reportUri, "Report URI should not be null"); HttpUrl url = new PathResolver.Builder() .addPath("rest_v2") .addPath("reports... | InputControlRestApi { @NotNull public List<InputControlState> requestInputControlsInitialStates(@NotNull String reportUri, boolean freshData) throws IOException, HttpException { Utils.checkNotNull(reportUri, "Report URI should not be null"); HttpUrl url = new PathResolver.Builder() .addPath("rest_v2") .addPath("reports... | InputControlRestApi { @NotNull public List<InputControlState> requestInputControlsInitialStates(@NotNull String reportUri, boolean freshData) throws IOException, HttpException { Utils.checkNotNull(reportUri, "Report URI should not be null"); HttpUrl url = new PathResolver.Builder() .addPath("rest_v2") .addPath("reports... | InputControlRestApi { @NotNull public List<InputControlState> requestInputControlsInitialStates(@NotNull String reportUri, boolean freshData) throws IOException, HttpException { Utils.checkNotNull(reportUri, "Report URI should not be null"); HttpUrl url = new PathResolver.Builder() .addPath("rest_v2") .addPath("reports... |
@Test public void apiShouldProvideFreshStatesForInputControls() throws Exception { List<ReportParameter> parameters = Collections.singletonList( new ReportParameter("sales_fact_ALL__store_sales_2013_1", Collections.singleton("19"))); MockResponse mockResponse = MockResponseFactory.create200() .setBody(icsStates.asStrin... | @NotNull public List<InputControlState> requestInputControlsStates(@NotNull String reportUri, @NotNull List<ReportParameter> parameters, boolean freshData) throws HttpException, IOException { Utils.checkNotNull(reportUri, "Report URI should not be null"); Utils.checkNotNull(parameters, "Parameters should not be null");... | InputControlRestApi { @NotNull public List<InputControlState> requestInputControlsStates(@NotNull String reportUri, @NotNull List<ReportParameter> parameters, boolean freshData) throws HttpException, IOException { Utils.checkNotNull(reportUri, "Report URI should not be null"); Utils.checkNotNull(parameters, "Parameters... | InputControlRestApi { @NotNull public List<InputControlState> requestInputControlsStates(@NotNull String reportUri, @NotNull List<ReportParameter> parameters, boolean freshData) throws HttpException, IOException { Utils.checkNotNull(reportUri, "Report URI should not be null"); Utils.checkNotNull(parameters, "Parameters... | InputControlRestApi { @NotNull public List<InputControlState> requestInputControlsStates(@NotNull String reportUri, @NotNull List<ReportParameter> parameters, boolean freshData) throws HttpException, IOException { Utils.checkNotNull(reportUri, "Report URI should not be null"); Utils.checkNotNull(parameters, "Parameters... | InputControlRestApi { @NotNull public List<InputControlState> requestInputControlsStates(@NotNull String reportUri, @NotNull List<ReportParameter> parameters, boolean freshData) throws HttpException, IOException { Utils.checkNotNull(reportUri, "Report URI should not be null"); Utils.checkNotNull(parameters, "Parameters... |
@Test public void executionIdShouldNotBeNullForCheckRequestExecutionStatus() throws Exception { mExpectedException.expect(NullPointerException.class); mExpectedException.expectMessage("Execution id should not be null"); restApiUnderTest.checkExportExecutionStatus(null, "any_id"); } | @NotNull public ExecutionStatus checkExportExecutionStatus(@NotNull String executionId, @NotNull String exportId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(exportId, "Export id should not be null"); HttpUrl url = new PathResolver.Builder()... | ReportExportRestApi { @NotNull public ExecutionStatus checkExportExecutionStatus(@NotNull String executionId, @NotNull String exportId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(exportId, "Export id should not be null"); HttpUrl url = new ... | ReportExportRestApi { @NotNull public ExecutionStatus checkExportExecutionStatus(@NotNull String executionId, @NotNull String exportId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(exportId, "Export id should not be null"); HttpUrl url = new ... | ReportExportRestApi { @NotNull public ExecutionStatus checkExportExecutionStatus(@NotNull String executionId, @NotNull String exportId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(exportId, "Export id should not be null"); HttpUrl url = new ... | ReportExportRestApi { @NotNull public ExecutionStatus checkExportExecutionStatus(@NotNull String executionId, @NotNull String exportId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(exportId, "Export id should not be null"); HttpUrl url = new ... |
@Test public void apiShouldProvideInputControlsListIfStateExcluded() throws Exception { MockResponse mockResponse = MockResponseFactory.create200() .setBody(icsWithoutStates.asString()); mWebMockRule.enqueue(mockResponse); Collection<InputControl> controls = restApiUnderTest.requestInputControls("/my/uri", null, true);... | @NotNull public List<InputControl> requestInputControls(@NotNull String reportUri, @Nullable Set<String> controlIds, boolean excludeState) throws IOException, HttpException { Utils.checkNotNull(reportUri, "Report URI should not be null"); String ids = ""; if (controlIds != null && !controlIds.isEmpty()) { ids = Utils.j... | InputControlRestApi { @NotNull public List<InputControl> requestInputControls(@NotNull String reportUri, @Nullable Set<String> controlIds, boolean excludeState) throws IOException, HttpException { Utils.checkNotNull(reportUri, "Report URI should not be null"); String ids = ""; if (controlIds != null && !controlIds.isEm... | InputControlRestApi { @NotNull public List<InputControl> requestInputControls(@NotNull String reportUri, @Nullable Set<String> controlIds, boolean excludeState) throws IOException, HttpException { Utils.checkNotNull(reportUri, "Report URI should not be null"); String ids = ""; if (controlIds != null && !controlIds.isEm... | InputControlRestApi { @NotNull public List<InputControl> requestInputControls(@NotNull String reportUri, @Nullable Set<String> controlIds, boolean excludeState) throws IOException, HttpException { Utils.checkNotNull(reportUri, "Report URI should not be null"); String ids = ""; if (controlIds != null && !controlIds.isEm... | InputControlRestApi { @NotNull public List<InputControl> requestInputControls(@NotNull String reportUri, @Nullable Set<String> controlIds, boolean excludeState) throws IOException, HttpException { Utils.checkNotNull(reportUri, "Report URI should not be null"); String ids = ""; if (controlIds != null && !controlIds.isEm... |
@Test public void apiShouldProvideInputControlsWithStates() throws Exception { MockResponse mockResponse = MockResponseFactory.create200() .setBody(icsWithStates.asString()); mWebMockRule.enqueue(mockResponse); Collection<InputControl> controls = restApiUnderTest.requestInputControls("/my/uri", null, false); assertThat... | @NotNull public List<InputControl> requestInputControls(@NotNull String reportUri, @Nullable Set<String> controlIds, boolean excludeState) throws IOException, HttpException { Utils.checkNotNull(reportUri, "Report URI should not be null"); String ids = ""; if (controlIds != null && !controlIds.isEmpty()) { ids = Utils.j... | InputControlRestApi { @NotNull public List<InputControl> requestInputControls(@NotNull String reportUri, @Nullable Set<String> controlIds, boolean excludeState) throws IOException, HttpException { Utils.checkNotNull(reportUri, "Report URI should not be null"); String ids = ""; if (controlIds != null && !controlIds.isEm... | InputControlRestApi { @NotNull public List<InputControl> requestInputControls(@NotNull String reportUri, @Nullable Set<String> controlIds, boolean excludeState) throws IOException, HttpException { Utils.checkNotNull(reportUri, "Report URI should not be null"); String ids = ""; if (controlIds != null && !controlIds.isEm... | InputControlRestApi { @NotNull public List<InputControl> requestInputControls(@NotNull String reportUri, @Nullable Set<String> controlIds, boolean excludeState) throws IOException, HttpException { Utils.checkNotNull(reportUri, "Report URI should not be null"); String ids = ""; if (controlIds != null && !controlIds.isEm... | InputControlRestApi { @NotNull public List<InputControl> requestInputControls(@NotNull String reportUri, @Nullable Set<String> controlIds, boolean excludeState) throws IOException, HttpException { Utils.checkNotNull(reportUri, "Report URI should not be null"); String ids = ""; if (controlIds != null && !controlIds.isEm... |
@Test public void apiShouldMapControlsIds() throws Exception { MockResponse mockResponse = MockResponseFactory.create200() .setBody(icsWithStates.asString()); mWebMockRule.enqueue(mockResponse); restApiUnderTest.requestInputControls("/my/uri", new LinkedHashSet<String>(Arrays.asList("1", "2")), false); RecordedRequest ... | @NotNull public List<InputControl> requestInputControls(@NotNull String reportUri, @Nullable Set<String> controlIds, boolean excludeState) throws IOException, HttpException { Utils.checkNotNull(reportUri, "Report URI should not be null"); String ids = ""; if (controlIds != null && !controlIds.isEmpty()) { ids = Utils.j... | InputControlRestApi { @NotNull public List<InputControl> requestInputControls(@NotNull String reportUri, @Nullable Set<String> controlIds, boolean excludeState) throws IOException, HttpException { Utils.checkNotNull(reportUri, "Report URI should not be null"); String ids = ""; if (controlIds != null && !controlIds.isEm... | InputControlRestApi { @NotNull public List<InputControl> requestInputControls(@NotNull String reportUri, @Nullable Set<String> controlIds, boolean excludeState) throws IOException, HttpException { Utils.checkNotNull(reportUri, "Report URI should not be null"); String ids = ""; if (controlIds != null && !controlIds.isEm... | InputControlRestApi { @NotNull public List<InputControl> requestInputControls(@NotNull String reportUri, @Nullable Set<String> controlIds, boolean excludeState) throws IOException, HttpException { Utils.checkNotNull(reportUri, "Report URI should not be null"); String ids = ""; if (controlIds != null && !controlIds.isEm... | InputControlRestApi { @NotNull public List<InputControl> requestInputControls(@NotNull String reportUri, @Nullable Set<String> controlIds, boolean excludeState) throws IOException, HttpException { Utils.checkNotNull(reportUri, "Report URI should not be null"); String ids = ""; if (controlIds != null && !controlIds.isEm... |
@Test public void list_input_controls_returns_empty_collection_on_204() throws Exception { mWebMockRule.enqueue(MockResponseFactory.create204()); List<InputControl> expected = restApiUnderTest.requestInputControls("/my/uri", new LinkedHashSet<String>(Arrays.asList("1", "2")), false); assertThat(expected, Matchers.is(Ma... | @NotNull public List<InputControl> requestInputControls(@NotNull String reportUri, @Nullable Set<String> controlIds, boolean excludeState) throws IOException, HttpException { Utils.checkNotNull(reportUri, "Report URI should not be null"); String ids = ""; if (controlIds != null && !controlIds.isEmpty()) { ids = Utils.j... | InputControlRestApi { @NotNull public List<InputControl> requestInputControls(@NotNull String reportUri, @Nullable Set<String> controlIds, boolean excludeState) throws IOException, HttpException { Utils.checkNotNull(reportUri, "Report URI should not be null"); String ids = ""; if (controlIds != null && !controlIds.isEm... | InputControlRestApi { @NotNull public List<InputControl> requestInputControls(@NotNull String reportUri, @Nullable Set<String> controlIds, boolean excludeState) throws IOException, HttpException { Utils.checkNotNull(reportUri, "Report URI should not be null"); String ids = ""; if (controlIds != null && !controlIds.isEm... | InputControlRestApi { @NotNull public List<InputControl> requestInputControls(@NotNull String reportUri, @Nullable Set<String> controlIds, boolean excludeState) throws IOException, HttpException { Utils.checkNotNull(reportUri, "Report URI should not be null"); String ids = ""; if (controlIds != null && !controlIds.isEm... | InputControlRestApi { @NotNull public List<InputControl> requestInputControls(@NotNull String reportUri, @Nullable Set<String> controlIds, boolean excludeState) throws IOException, HttpException { Utils.checkNotNull(reportUri, "Report URI should not be null"); String ids = ""; if (controlIds != null && !controlIds.isEm... |
@Test public void list_input_control_initial_states_returns_empty_collection_on_204() throws Exception { mWebMockRule.enqueue(MockResponseFactory.create204()); List<InputControlState> expected = restApiUnderTest.requestInputControlsInitialStates("/my/uri", false); assertThat(expected, Matchers.is(Matchers.empty())); } | @NotNull public List<InputControlState> requestInputControlsInitialStates(@NotNull String reportUri, boolean freshData) throws IOException, HttpException { Utils.checkNotNull(reportUri, "Report URI should not be null"); HttpUrl url = new PathResolver.Builder() .addPath("rest_v2") .addPath("reports") .addPaths(reportUri... | InputControlRestApi { @NotNull public List<InputControlState> requestInputControlsInitialStates(@NotNull String reportUri, boolean freshData) throws IOException, HttpException { Utils.checkNotNull(reportUri, "Report URI should not be null"); HttpUrl url = new PathResolver.Builder() .addPath("rest_v2") .addPath("reports... | InputControlRestApi { @NotNull public List<InputControlState> requestInputControlsInitialStates(@NotNull String reportUri, boolean freshData) throws IOException, HttpException { Utils.checkNotNull(reportUri, "Report URI should not be null"); HttpUrl url = new PathResolver.Builder() .addPath("rest_v2") .addPath("reports... | InputControlRestApi { @NotNull public List<InputControlState> requestInputControlsInitialStates(@NotNull String reportUri, boolean freshData) throws IOException, HttpException { Utils.checkNotNull(reportUri, "Report URI should not be null"); HttpUrl url = new PathResolver.Builder() .addPath("rest_v2") .addPath("reports... | InputControlRestApi { @NotNull public List<InputControlState> requestInputControlsInitialStates(@NotNull String reportUri, boolean freshData) throws IOException, HttpException { Utils.checkNotNull(reportUri, "Report URI should not be null"); HttpUrl url = new PathResolver.Builder() .addPath("rest_v2") .addPath("reports... |
@Test public void list_input_control_states_returns_empty_collection_on_204() throws Exception { mWebMockRule.enqueue(MockResponseFactory.create204()); List<InputControlState> expected = restApiUnderTest.requestInputControlsStates("/my/uri", Collections.<ReportParameter>emptyList(), false); assertThat(expected, Matcher... | @NotNull public List<InputControlState> requestInputControlsStates(@NotNull String reportUri, @NotNull List<ReportParameter> parameters, boolean freshData) throws HttpException, IOException { Utils.checkNotNull(reportUri, "Report URI should not be null"); Utils.checkNotNull(parameters, "Parameters should not be null");... | InputControlRestApi { @NotNull public List<InputControlState> requestInputControlsStates(@NotNull String reportUri, @NotNull List<ReportParameter> parameters, boolean freshData) throws HttpException, IOException { Utils.checkNotNull(reportUri, "Report URI should not be null"); Utils.checkNotNull(parameters, "Parameters... | InputControlRestApi { @NotNull public List<InputControlState> requestInputControlsStates(@NotNull String reportUri, @NotNull List<ReportParameter> parameters, boolean freshData) throws HttpException, IOException { Utils.checkNotNull(reportUri, "Report URI should not be null"); Utils.checkNotNull(parameters, "Parameters... | InputControlRestApi { @NotNull public List<InputControlState> requestInputControlsStates(@NotNull String reportUri, @NotNull List<ReportParameter> parameters, boolean freshData) throws HttpException, IOException { Utils.checkNotNull(reportUri, "Report URI should not be null"); Utils.checkNotNull(parameters, "Parameters... | InputControlRestApi { @NotNull public List<InputControlState> requestInputControlsStates(@NotNull String reportUri, @NotNull List<ReportParameter> parameters, boolean freshData) throws HttpException, IOException { Utils.checkNotNull(reportUri, "Report URI should not be null"); Utils.checkNotNull(parameters, "Parameters... |
@Test public void shouldEnableGsonExposeAnnotationField() throws Exception { GsonBuilder gsonBuilder = PowerMockito.mock(GsonBuilder.class); whenNew(GsonBuilder.class).withNoArguments().thenReturn(gsonBuilder); GsonFactory.create(); verify(gsonBuilder, times(1)).excludeFieldsWithoutExposeAnnotation(); } | public static Gson create() { GsonBuilder gsonBuilder = new GsonBuilder(); gsonBuilder.excludeFieldsWithoutExposeAnnotation(); gsonBuilder.disableHtmlEscaping(); gsonBuilder.registerTypeAdapterFactory(new ReportLookupTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new InputControlTypeAdapterFactory()); gs... | GsonFactory { public static Gson create() { GsonBuilder gsonBuilder = new GsonBuilder(); gsonBuilder.excludeFieldsWithoutExposeAnnotation(); gsonBuilder.disableHtmlEscaping(); gsonBuilder.registerTypeAdapterFactory(new ReportLookupTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new InputControlTypeAdapter... | GsonFactory { public static Gson create() { GsonBuilder gsonBuilder = new GsonBuilder(); gsonBuilder.excludeFieldsWithoutExposeAnnotation(); gsonBuilder.disableHtmlEscaping(); gsonBuilder.registerTypeAdapterFactory(new ReportLookupTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new InputControlTypeAdapter... | GsonFactory { public static Gson create() { GsonBuilder gsonBuilder = new GsonBuilder(); gsonBuilder.excludeFieldsWithoutExposeAnnotation(); gsonBuilder.disableHtmlEscaping(); gsonBuilder.registerTypeAdapterFactory(new ReportLookupTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new InputControlTypeAdapter... | GsonFactory { public static Gson create() { GsonBuilder gsonBuilder = new GsonBuilder(); gsonBuilder.excludeFieldsWithoutExposeAnnotation(); gsonBuilder.disableHtmlEscaping(); gsonBuilder.registerTypeAdapterFactory(new ReportLookupTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new InputControlTypeAdapter... |
@Test public void shouldDisableHtmlEscaping() throws Exception { GsonBuilder gsonBuilder = PowerMockito.mock(GsonBuilder.class); whenNew(GsonBuilder.class).withNoArguments().thenReturn(gsonBuilder); GsonFactory.create(); verify(gsonBuilder, times(1)).disableHtmlEscaping(); } | public static Gson create() { GsonBuilder gsonBuilder = new GsonBuilder(); gsonBuilder.excludeFieldsWithoutExposeAnnotation(); gsonBuilder.disableHtmlEscaping(); gsonBuilder.registerTypeAdapterFactory(new ReportLookupTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new InputControlTypeAdapterFactory()); gs... | GsonFactory { public static Gson create() { GsonBuilder gsonBuilder = new GsonBuilder(); gsonBuilder.excludeFieldsWithoutExposeAnnotation(); gsonBuilder.disableHtmlEscaping(); gsonBuilder.registerTypeAdapterFactory(new ReportLookupTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new InputControlTypeAdapter... | GsonFactory { public static Gson create() { GsonBuilder gsonBuilder = new GsonBuilder(); gsonBuilder.excludeFieldsWithoutExposeAnnotation(); gsonBuilder.disableHtmlEscaping(); gsonBuilder.registerTypeAdapterFactory(new ReportLookupTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new InputControlTypeAdapter... | GsonFactory { public static Gson create() { GsonBuilder gsonBuilder = new GsonBuilder(); gsonBuilder.excludeFieldsWithoutExposeAnnotation(); gsonBuilder.disableHtmlEscaping(); gsonBuilder.registerTypeAdapterFactory(new ReportLookupTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new InputControlTypeAdapter... | GsonFactory { public static Gson create() { GsonBuilder gsonBuilder = new GsonBuilder(); gsonBuilder.excludeFieldsWithoutExposeAnnotation(); gsonBuilder.disableHtmlEscaping(); gsonBuilder.registerTypeAdapterFactory(new ReportLookupTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new InputControlTypeAdapter... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.