use of org.sonar.server.ws.WsActionTester in project sonarqube by SonarSource.
the class RuleQueryFactoryTest method execute.
private RuleQuery execute(String... paramsKeyAndValue) {
WsActionTester ws = new WsActionTester(fakeAction);
TestRequest request = ws.newRequest();
for (int i = 0; i < paramsKeyAndValue.length; i += 2) {
request.setParam(paramsKeyAndValue[i], paramsKeyAndValue[i + 1]);
}
request.execute();
return fakeAction.getRuleQuery();
}
use of org.sonar.server.ws.WsActionTester in project sonarqube by SonarSource.
the class SearchActionTest method setUp.
@Before
public void setUp() {
xoo1 = LanguageTesting.newLanguage("xoo1");
xoo2 = LanguageTesting.newLanguage("xoo2");
Languages languages = new Languages(xoo1, xoo2);
ws = new WsActionTester(new SearchAction(new SearchDataLoader(languages, new QProfileLookup(dbClient), new QProfileFactory(dbClient, defaultOrganizationProvider), dbClient, new ComponentFinder(dbClient), activeRuleIndex), languages));
}
use of org.sonar.server.ws.WsActionTester in project sonarqube by SonarSource.
the class TreeActionTest method setUp.
@Before
public void setUp() {
ws = new WsActionTester(new TreeAction(dbClient, new ComponentFinder(dbClient), resourceTypes, userSession, Mockito.mock(I18n.class)));
resourceTypes.setChildrenQualifiers(Qualifiers.MODULE, Qualifiers.FILE, Qualifiers.DIRECTORY);
resourceTypes.setLeavesQualifiers(Qualifiers.FILE, Qualifiers.UNIT_TEST_FILE);
}
use of org.sonar.server.ws.WsActionTester in project sonarqube by SonarSource.
the class SearchActionTest method setUp.
@Before
public void setUp() {
resourceTypes.setAllQualifiers(PROJECT, MODULE, DIRECTORY, FILE);
when(languages.all()).thenReturn(javaLanguage());
ws = new WsActionTester(new SearchAction(db.getDbClient(), resourceTypes, i18n, userSession, languages, defaultOrganizationProvider));
user = db.users().insertUser("john");
userSession.logIn(user);
}
use of org.sonar.server.ws.WsActionTester in project sonarqube by SonarSource.
the class ListActionTest method setUp.
@Before
public void setUp() {
NotificationDispatcherMetadata metadata1 = NotificationDispatcherMetadata.create(NOTIF_MY_NEW_ISSUES).setProperty(GLOBAL_NOTIFICATION, "true").setProperty(PER_PROJECT_NOTIFICATION, "true");
NotificationDispatcherMetadata metadata2 = NotificationDispatcherMetadata.create(NOTIF_NEW_ISSUES).setProperty(GLOBAL_NOTIFICATION, "true");
NotificationDispatcherMetadata metadata3 = NotificationDispatcherMetadata.create(NOTIF_NEW_QUALITY_GATE_STATUS).setProperty(GLOBAL_NOTIFICATION, "true").setProperty(PER_PROJECT_NOTIFICATION, "true");
NotificationCenter notificationCenter = new NotificationCenter(new NotificationDispatcherMetadata[] { metadata1, metadata2, metadata3 }, new NotificationChannel[] { emailChannel, twitterChannel });
notificationUpdater = new NotificationUpdater(userSession, dbClient);
ListAction underTest = new ListAction(notificationCenter, dbClient, userSession);
ws = new WsActionTester(underTest);
}
Aggregations