@Test public void testRetrieveOrMakeFilter() { when(searchRequestService.getFilter( new JiraServiceContextImpl(ANONYMOUS, new SimpleErrorCollection()), 10000L)) .thenReturn(searchRequest); final ChartUtils chartUtils = new Fixture(); final Map<String, Object> params = new HashMap<String, Object>(4); final SearchRequest request = chartUtils.retrieveOrMakeSearchRequest("filter-10000", params); assertThat(request, sameInstance(searchRequest)); assertThat(params, hasEntry("searchRequest", searchRequest)); assertThat(params, not(hasKey("project"))); // cant test the project case since that crates a ProjectClause, which initialises the world via // the // ComponentManager.getInstance. }
protected SearchRequest getFilter() { if (filter == null && getFilterId() != null) { filter = searchRequestService.getFilter(getJiraServiceContext(), getFilterId()); } return filter; }