use of org.sonar.server.ws.WsTester 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();
}
use of org.sonar.server.ws.WsTester 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();
}
use of org.sonar.server.ws.WsTester in project sonarqube by SonarSource.
the class MetricsActionTest method setUp.
@Before
public void setUp() throws Exception {
es.putDocuments(UserIndexDefinition.INDEX_TYPE_USER.getIndex(), UserIndexDefinition.INDEX_TYPE_USER.getType(), new UserDoc().setLogin("login").setName("Login").setEmail("login@login.com").setActive(true));
ws = new WsTester(new CustomMeasuresWs(new MetricsAction(dbClient, userSession, new ComponentFinder(dbClient))));
defaultProject = insertDefaultProject();
userSession.logIn().addProjectUuidPermissions(UserRole.ADMIN, defaultProject.uuid());
}
use of org.sonar.server.ws.WsTester in project sonarqube by SonarSource.
the class TimeMachineWsTest method setUp.
@Before
public void setUp() {
WsTester tester = new WsTester(new TimeMachineWs());
controller = tester.controller("api/timemachine");
}
use of org.sonar.server.ws.WsTester in project sonarqube by SonarSource.
the class DomainsActionTest method setUp.
@Before
public void setUp() {
dbClient = new DbClient(db.database(), db.myBatis(), new MetricDao());
dbSession = dbClient.openSession(false);
ws = new WsTester(new MetricsWs(new DomainsAction(dbClient)));
}
Aggregations