use of org.sonar.server.issue.AvatarResolverImpl in project sonarqube by SonarSource.
the class SearchUsersActionTest method test_example.
@Test
public void test_example() {
avatarResolver = new AvatarResolverImpl();
ws = new WsActionTester(new SearchUsersAction(db.getDbClient(), wsSupport, LANGUAGES, avatarResolver));
QProfileDto profile = db.qualityProfiles().insert(p -> p.setLanguage(XOO));
UserDto user1 = db.users().insertUser(u -> u.setLogin("admin").setName("Administrator").setEmail("admin@email.com"));
UserDto user2 = db.users().insertUser(u -> u.setLogin("george.orwell").setName("George Orwell").setEmail("george@orwell.com"));
db.qualityProfiles().addUserPermission(profile, user1);
userSession.logIn().addPermission(ADMINISTER_QUALITY_PROFILES);
String result = ws.newRequest().setParam(PARAM_QUALITY_PROFILE, profile.getName()).setParam(PARAM_LANGUAGE, XOO).setParam(SELECTED, "all").setMediaType(JSON).execute().getInput();
assertJson(result).isSimilarTo(ws.getDef().responseExampleAsString());
}
use of org.sonar.server.issue.AvatarResolverImpl in project sonarqube by SonarSource.
the class SearchUsersActionTest method test_example.
@Test
public void test_example() {
avatarResolver = new AvatarResolverImpl();
ws = new WsActionTester(new SearchUsersAction(db.getDbClient(), wsSupport, avatarResolver));
QualityGateDto gate = db.qualityGates().insertQualityGate();
UserDto user1 = db.users().insertUser(u -> u.setLogin("admin").setName("Administrator").setEmail("admin@email.com"));
UserDto user2 = db.users().insertUser(u -> u.setLogin("george.orwell").setName("George Orwell").setEmail("george@orwell.com"));
db.qualityGates().addUserPermission(gate, user1);
userSession.logIn().addPermission(ADMINISTER_QUALITY_GATES);
String result = ws.newRequest().setParam(PARAM_GATE_NAME, gate.getName()).setParam(SELECTED, "all").setMediaType(JSON).execute().getInput();
assertJson(result).isSimilarTo(ws.getDef().responseExampleAsString());
}
Aggregations