Examples of DefaultIssueFilter


Examples of org.sonar.core.issue.DefaultIssueFilter

    verify(issueFilterService).serializeFilterQuery(props);
  }

  @Test
  public void deserialize_filter_query() {
    DefaultIssueFilter issueFilter = new DefaultIssueFilter();
    service.deserializeFilterQuery(issueFilter);
    verify(issueFilterService).deserializeIssueFilterQuery(issueFilter);
  }
View Full Code Here

Examples of org.sonar.core.issue.DefaultIssueFilter

    verify(issueFilterService).toggleFavouriteIssueFilter(eq(10L), any(UserSession.class));
  }

  @Test
  public void check_if_user_is_authorized_to_see_issue_filter() {
    DefaultIssueFilter issueFilter = new DefaultIssueFilter();
    service.isUserAuthorized(issueFilter);
    verify(issueFilterService).getLoggedLogin(any(UserSession.class));
    verify(issueFilterService).verifyCurrentUserCanReadFilter(eq(issueFilter), anyString());
  }
View Full Code Here

Examples of org.sonar.core.issue.DefaultIssueFilter

  @Test
  public void logged_in_app_with_favorites() throws Exception {
    MockUserSession session = MockUserSession.set().setLogin("eric").setUserId(123);
    when(service.findFavoriteFilters(session)).thenReturn(Arrays.asList(
      new DefaultIssueFilter().setId(6L).setName("My issues"),
      new DefaultIssueFilter().setId(13L).setName("Blocker issues")
    ));
    tester.newGetRequest("api/issue_filters", "app").execute()
      .assertJson(getClass(), "logged_in_page_with_favorites.json");
  }
View Full Code Here

Examples of org.sonar.core.issue.DefaultIssueFilter

  @Test
  public void logged_in_app_with_selected_filter() throws Exception {
    MockUserSession session = MockUserSession.set().setLogin("eric").setUserId(123);
    when(service.find(13L, session)).thenReturn(
      new DefaultIssueFilter().setId(13L).setName("Blocker issues").setData("severity=BLOCKER").setUser("eric")
    );

    tester.newGetRequest("api/issue_filters", "app").setParam("id", "13").execute()
      .assertJson(getClass(), "logged_in_page_with_selected_filter.json");
  }
View Full Code Here

Examples of org.sonar.core.issue.DefaultIssueFilter

  @Test
  public void app_selected_filter_can_not_be_modified() throws Exception {
    // logged-in user is 'eric' but filter is owned by 'simon'
    MockUserSession session = MockUserSession.set().setLogin("eric").setUserId(123).setGlobalPermissions("none");
    when(service.find(13L, session)).thenReturn(
      new DefaultIssueFilter().setId(13L).setName("Blocker issues").setData("severity=BLOCKER").setUser("simon").setShared(true)
    );

    tester.newGetRequest("api/issue_filters", "app").setParam("id", "13").execute()
      .assertJson(getClass(), "selected_filter_can_not_be_modified.json");
  }
View Full Code Here

Examples of org.sonar.core.issue.DefaultIssueFilter

  @Test
  public void write_filter() throws Exception {
    UserSession userSession = MockUserSession.set();
    test(userSession,
      new DefaultIssueFilter()
        .setId(13L)
        .setName("Blocker issues")
        .setDescription("All Blocker Issues")
        .setShared(true)
        .setUser("simon")
View Full Code Here

Examples of org.sonar.core.issue.DefaultIssueFilter

  @Test
  public void can_modify_if_logged_user_own_filter() throws Exception {
    UserSession userSession = MockUserSession.set().setLogin("simon");
    test(userSession,
      new DefaultIssueFilter()
        .setId(13L)
        .setName("Blocker issues")
        .setDescription("All Blocker Issues")
        .setShared(true)
        .setUser("simon")
View Full Code Here

Examples of org.sonar.core.issue.DefaultIssueFilter

  @Test
  public void can_modify_if_logged_user_has_permission() throws Exception {
    UserSession userSession = MockUserSession.set().setLogin("simon").setGlobalPermissions(GlobalPermissions.SYSTEM_ADMIN);
    test(userSession,
      new DefaultIssueFilter()
        .setId(13L)
        .setName("Blocker issues")
        .setDescription("All Blocker Issues")
        .setShared(true)
        .setUser("julien")
View Full Code Here

Examples of org.sonar.core.issue.DefaultIssueFilter

    JsonWriter json = response.newJsonWriter();
    json.beginObject();

    // Current filter (optional)
    Integer filterId = request.paramAsInt("id");
    DefaultIssueFilter filter = null;
    if (filterId != null && filterId >= 0) {
      filter = service.find((long) filterId, session);
    }

    // Permissions
View Full Code Here

Examples of org.sonar.core.issue.DefaultIssueFilter

  public DefaultIssueFilter updateFilterQuery(Long issueFilterId, Map<String, Object> filterQuery, UserSession userSession) {
    String login = getLoggedLogin(userSession);
    IssueFilterDto issueFilterDto = findIssueFilterDto(issueFilterId, login);
    verifyCurrentUserCanModifyFilter(issueFilterDto.toIssueFilter(), login);

    DefaultIssueFilter issueFilter = issueFilterDto.toIssueFilter();
    issueFilter.setData(serializeFilterQuery(filterQuery));
    filterDao.update(IssueFilterDto.toIssueFilter(issueFilter));
    return issueFilter;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.