use of org.sonar.server.ws.WsTester in project sonarqube by SonarSource.
the class UpdateActionTest method setUp.
@Before
public void setUp() {
dbClient.groupDao().insert(session, newGroupDto().setName("sonar-users"));
session.commit();
userIndexer = new UserIndexer(dbClient, esTester.client());
tester = new WsTester(new UsersWs(new UpdateAction(new UserUpdater(mock(NewUserNotifier.class), settings, dbClient, userIndexer, system2, defaultOrganizationProvider, ORGANIZATION_CREATION_NOT_USED_FOR_UPDATE), userSessionRule, new UserJsonWriter(userSessionRule), dbClient)));
}
use of org.sonar.server.ws.WsTester in project sonarqube by SonarSource.
the class RemoveUserActionTest method setUp.
@Before
public void setUp() {
GroupWsSupport groupSupport = new GroupWsSupport(db.getDbClient(), defaultOrganizationProvider);
ws = new WsTester(new UserGroupsWs(new RemoveUserAction(db.getDbClient(), userSession, groupSupport)));
}
use of org.sonar.server.ws.WsTester in project sonarqube by SonarSource.
the class UserTokensWsTest method setUp.
@Before
public void setUp() {
UserSession userSession = mock(UserSession.class);
DbClient dbClient = mock(DbClient.class);
System2 system = mock(System2.class);
TokenGenerator tokenGenerator = mock(TokenGenerator.class);
ws = new WsTester(new UserTokensWs(new GenerateAction(dbClient, userSession, system, tokenGenerator), new RevokeAction(dbClient, userSession), new SearchAction(dbClient, userSession)));
}
use of org.sonar.server.ws.WsTester in project sonarqube by SonarSource.
the class UpdateActionTest method setUp.
@Before
public void setUp() throws Exception {
GroupWsSupport groupSupport = new GroupWsSupport(db.getDbClient(), defaultOrganizationProvider);
ws = new WsTester(new UserGroupsWs(new UpdateAction(db.getDbClient(), userSession, groupSupport, settings, defaultOrganizationProvider)));
when(settings.getString(DEFAULT_GROUP_NAME_KEY)).thenReturn(DEFAULT_GROUP_NAME_VALUE);
}
use of org.sonar.server.ws.WsTester in project sonarqube by SonarSource.
the class UserGroupsWsTest method setUp.
@Before
public void setUp() {
GroupWsSupport wsSupport = mock(GroupWsSupport.class);
WsTester tester = new WsTester(new UserGroupsWs(new SearchAction(mock(DbClient.class), mock(UserSession.class), wsSupport), new CreateAction(mock(DbClient.class), mock(UserSession.class), wsSupport)));
controller = tester.controller("api/user_groups");
}
Aggregations