use of org.sonar.server.ws.WsTester in project sonarqube by SonarSource.
the class QualityGatesWsTest method setUp.
@Before
public void setUp() {
SelectAction selectAction = new SelectAction(mock(DbClient.class), mock(UserSessionRule.class), mock(ComponentFinder.class));
tester = new WsTester(new QualityGatesWs(new ListAction(qGates), new ShowAction(qGates), new SearchAction(projectFinder), new CreateAction(null, null, null, null), new CopyAction(qGates), new DestroyAction(qGates), new RenameAction(qGates), new SetAsDefaultAction(qGates), new UnsetDefaultAction(qGates), new CreateConditionAction(null, null, null, null), new UpdateConditionAction(null, null, null, null), new DeleteConditionAction(qGates), selectAction, new DeselectAction(qGates, mock(DbClient.class), mock(ComponentFinder.class)), new AppAction(null, null, null)));
}
use of org.sonar.server.ws.WsTester in project sonarqube by SonarSource.
the class CompareActionMediumTest method setUp.
@Before
public void setUp() {
tester.clearDbAndIndexes();
db = tester.get(DbClient.class);
session = db.openSession(false);
wsTester = new WsTester(tester.get(QProfilesWs.class));
}
use of org.sonar.server.ws.WsTester in project sonarqube by SonarSource.
the class DeleteActionTest method setUp.
@Before
public void setUp() {
xoo1 = LanguageTesting.newLanguage("xoo1");
xoo2 = LanguageTesting.newLanguage("xoo2");
tester = new WsTester(new QProfilesWs(mock(RuleActivationActions.class), mock(BulkRuleActivationActions.class), new DeleteAction(new Languages(xoo1, xoo2), new QProfileFactory(dbClient, defaultOrganizationProvider), dbClient, new QProfileWsSupport(userSessionRule, defaultOrganizationProvider))));
}
use of org.sonar.server.ws.WsTester in project sonarqube by SonarSource.
the class ExportersActionTest method importers_nominal.
@Test
public void importers_nominal() throws Exception {
WsTester wsTester = new WsTester(new QProfilesWs(mock(RuleActivationActions.class), mock(BulkRuleActivationActions.class), new ExportersAction(createExporters())));
wsTester.newGetRequest("api/qualityprofiles", "exporters").execute().assertJson(getClass(), "exporters.json");
}
use of org.sonar.server.ws.WsTester in project sonarqube by SonarSource.
the class QProfileRefTest method define_ws_parameters.
@Test
public void define_ws_parameters() {
WsTester wsTester = new WsTester();
WebService.NewController controller = wsTester.context().createController("api/qualityprofiles");
WebService.NewAction newAction = controller.createAction("do").setHandler((request, response) -> {
});
Languages languages = new Languages(new FakeLanguage("java"), new FakeLanguage("js"));
QProfileRef.defineParams(newAction, languages);
controller.done();
WebService.Action action = wsTester.controller("api/qualityprofiles").action("do");
assertThat(action.param("language")).isNotNull();
assertThat(action.param("language").possibleValues()).containsOnly("java", "js");
assertThat(action.param("profileKey")).isNotNull();
assertThat(action.param("profileName")).isNotNull();
}
Aggregations