Search in sources :

Example 1 with UserJsonWriter

use of org.sonar.server.user.ws.UserJsonWriter in project sonarqube by SonarSource.

the class CreateActionTest method setUp.

@Before
public void setUp() {
    ws = new WsTester(new CustomMeasuresWs(new CreateAction(dbClient, userSession, System2.INSTANCE, new CustomMeasureValidator(newFullTypeValidations()), new CustomMeasureJsonWriter(new UserJsonWriter(userSession)), new ComponentFinder(dbClient))));
    db.getDbClient().userDao().insert(dbSession, new UserDto().setLogin("login").setName("Login").setEmail("login@login.com").setActive(true));
    dbSession.commit();
    userSession.logIn("login").addProjectUuidPermissions(UserRole.ADMIN, DEFAULT_PROJECT_UUID);
}
Also used : ComponentFinder(org.sonar.server.component.ComponentFinder) WsTester(org.sonar.server.ws.WsTester) UserJsonWriter(org.sonar.server.user.ws.UserJsonWriter) UserDto(org.sonar.db.user.UserDto) Before(org.junit.Before)

Example 2 with UserJsonWriter

use of org.sonar.server.user.ws.UserJsonWriter in project sonarqube by SonarSource.

the class SearchActionTest method setUp.

@Before
public void setUp() {
    CustomMeasureJsonWriter customMeasureJsonWriter = new CustomMeasureJsonWriter(new UserJsonWriter(userSessionRule));
    ws = new WsTester(new CustomMeasuresWs(new SearchAction(dbClient, customMeasureJsonWriter, userSessionRule, new ComponentFinder(dbClient))));
    defaultProject = insertDefaultProject();
    userSessionRule.logIn().addProjectUuidPermissions(UserRole.ADMIN, defaultProject.uuid());
    db.getDbClient().userDao().insert(dbSession, new UserDto().setLogin("login").setName("Login").setEmail("login@login.com").setActive(true));
    dbSession.commit();
}
Also used : ComponentFinder(org.sonar.server.component.ComponentFinder) WsTester(org.sonar.server.ws.WsTester) UserJsonWriter(org.sonar.server.user.ws.UserJsonWriter) UserDto(org.sonar.db.user.UserDto) Before(org.junit.Before)

Example 3 with UserJsonWriter

use of org.sonar.server.user.ws.UserJsonWriter in project sonarqube by SonarSource.

the class UpdateActionTest method setUp.

@Before
public void setUp() {
    CustomMeasureValidator validator = new CustomMeasureValidator(newFullTypeValidations());
    ws = new WsTester(new CustomMeasuresWs(new UpdateAction(dbClient, userSessionRule, system, validator, new CustomMeasureJsonWriter(new UserJsonWriter(userSessionRule)))));
    db.getDbClient().userDao().insert(dbSession, new UserDto().setLogin("login").setName("Login").setEmail("login@login.com").setActive(true));
    dbSession.commit();
}
Also used : WsTester(org.sonar.server.ws.WsTester) UserJsonWriter(org.sonar.server.user.ws.UserJsonWriter) UserDto(org.sonar.db.user.UserDto) Before(org.junit.Before)

Aggregations

Before (org.junit.Before)3 UserDto (org.sonar.db.user.UserDto)3 UserJsonWriter (org.sonar.server.user.ws.UserJsonWriter)3 WsTester (org.sonar.server.ws.WsTester)3 ComponentFinder (org.sonar.server.component.ComponentFinder)2