예제 #1
0
  @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.
  }
예제 #2
0
 protected SearchRequest getFilter() {
   if (filter == null && getFilterId() != null) {
     filter = searchRequestService.getFilter(getJiraServiceContext(), getFilterId());
   }
   return filter;
 }
예제 #3
0
 public long getNumberOfOtherFavouritedFilters() {
   Collection requests = searchRequestService.getFiltersFavouritedByOthers(getUser());
   return requests.size();
 }
예제 #4
0
 public long getNumberOfFilters() {
   Collection requests = searchRequestService.getNonPrivateFilters(getUser());
   return requests.size();
 }