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