Tabnine Logo
UserQuery$Builder.mustBeRoot
Code IndexAdd Tabnine to your IDE (free)

How to use
mustBeRoot
method
in
org.sonar.api.user.UserQuery$Builder

Best Java code snippets using org.sonar.api.user.UserQuery$Builder.mustBeRoot (Showing top 3 results out of 315)

origin: SonarSource/sonarqube

@Test
public void selectUsers_returns_both_only_root_or_only_non_root_depending_on_mustBeRoot_and_mustNotBeRoot_calls_on_query() {
 UserDto user1 = insertUser(true);
 UserDto root1 = insertRootUser(newUserDto());
 UserDto user2 = insertUser(true);
 UserDto root2 = insertRootUser(newUserDto());
 assertThat(underTest.selectUsers(session, UserQuery.builder().build()))
  .extracting(UserDto::getLogin)
  .containsOnly(user1.getLogin(), user2.getLogin(), root1.getLogin(), root2.getLogin());
 assertThat(underTest.selectUsers(session, UserQuery.builder().mustBeRoot().build()))
  .extracting(UserDto::getLogin)
  .containsOnly(root1.getLogin(), root2.getLogin());
 assertThat(underTest.selectUsers(session, UserQuery.builder().mustNotBeRoot().build()))
  .extracting(UserDto::getLogin)
  .containsOnly(user1.getLogin(), user2.getLogin());
}
origin: org.sonarsource.sonarqube/sonar-server

@Override
public void handle(Request request, Response response) throws Exception {
 userSession.checkIsRoot();
 try (DbSession dbSession = dbClient.openSession(false)) {
  List<UserDto> userDtos = dbClient.userDao().selectUsers(
    dbSession,
    UserQuery.builder()
      .mustBeRoot()
      .build());
  writeResponse(request, response, userDtos);
 }
}
origin: SonarSource/sonarqube

@Override
public void handle(Request request, Response response) throws Exception {
 userSession.checkIsRoot();
 try (DbSession dbSession = dbClient.openSession(false)) {
  List<UserDto> userDtos = dbClient.userDao().selectUsers(
    dbSession,
    UserQuery.builder()
      .mustBeRoot()
      .build());
  writeResponse(request, response, userDtos);
 }
}
org.sonar.api.userUserQuery$BuildermustBeRoot

Popular methods of UserQuery$Builder

  • build
  • <init>
  • includeDeactivated
  • logins
  • searchText
  • mustNotBeRoot

Popular in Java

  • Parsing JSON documents to java classes using gson
  • setScale (BigDecimal)
  • getResourceAsStream (ClassLoader)
  • startActivity (Activity)
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • LogFactory (org.apache.commons.logging)
    Factory for creating Log instances, with discovery and configuration features similar to that employ
  • Runner (org.openjdk.jmh.runner)
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now