コード例 #1
0
ファイル: GroupsActionTest.java プロジェクト: ihr/sonarqube
  @Test
  public void search_with_selection() {
    String result =
        ws.newRequest()
            .setParam(PARAM_PERMISSION, GlobalPermissions.SCAN_EXECUTION)
            .setParam(SELECTED, SelectionMode.ALL.value())
            .execute()
            .getInput();

    assertThat(result).containsSequence(DefaultGroups.ANYONE, "group-1", "group-2", "group-3");
  }
コード例 #2
0
ファイル: GroupsActionTest.java プロジェクト: ihr/sonarqube
  @Test
  public void search_with_admin_does_not_return_anyone() {
    String result =
        ws.newRequest()
            .setParam(PARAM_PERMISSION, GlobalPermissions.SYSTEM_ADMIN)
            .setParam(SELECTED, SelectionMode.ALL.value())
            .execute()
            .getInput();

    assertThat(result)
        .containsSequence("group-1", "group-2", "group-3")
        .doesNotContain(DefaultGroups.ANYONE);
  }
コード例 #3
0
  @Test
  public void paging() throws Exception {
    GroupDto group = insertGroup();
    UserDto groupUser = insertUser("ada", "Ada Lovelace");
    insertUser("grace", "Grace Hopper");
    addUserToGroup(groupUser, group);
    session.commit();

    newUsersRequest()
        .setParam("id", group.getId().toString())
        .setParam("ps", "1")
        .setParam(Param.SELECTED, SelectionMode.ALL.value())
        .execute()
        .assertJson(getClass(), "all_page1.json");

    newUsersRequest()
        .setParam("id", group.getId().toString())
        .setParam("ps", "1")
        .setParam("p", "2")
        .setParam(Param.SELECTED, SelectionMode.ALL.value())
        .execute()
        .assertJson(getClass(), "all_page2.json");
  }