use of org.sonar.server.ws.WsTester in project sonarqube by SonarSource.
the class TestsWsTest method setUp.
@Before
public void setUp() {
WsTester tester = new WsTester(new TestsWs(new ListAction(mock(DbClient.class), mock(TestIndex.class), userSessionRule, mock(ComponentFinder.class)), new CoveredFilesAction(mock(DbClient.class), mock(TestIndex.class), userSessionRule)));
controller = tester.controller("api/tests");
}
use of org.sonar.server.ws.WsTester in project sonarqube by SonarSource.
the class WebServicesWsTest method list.
@Test
public void list() throws Exception {
WsTester tester = new WsTester(underTest, new MetricWs());
String response = tester.newGetRequest("api/webservices", "list").execute().outputAsString();
assertJson(response).withStrictArrayOrder().isSimilarTo(getClass().getResource("list-example.json"));
}
use of org.sonar.server.ws.WsTester in project sonarqube by SonarSource.
the class WebServicesWsTest method response_example.
@Test
public void response_example() throws Exception {
WsTester tester = new WsTester(underTest, new MetricWs());
tester.newGetRequest("api/webservices", "response_example").setParam("controller", "api/metric").setParam("action", "create").execute().assertJson(getClass(), "response_example.json");
}
use of org.sonar.server.ws.WsTester in project sonarqube by SonarSource.
the class DeleteActionTest method setUp.
@Before
public void setUp() {
defaultGroup = db.users().insertGroup(db.getDefaultOrganization(), CoreProperties.CORE_DEFAULT_GROUP_DEFAULT_VALUE);
Settings settings = new MapSettings().setProperty(CoreProperties.CORE_DEFAULT_GROUP, CoreProperties.CORE_DEFAULT_GROUP_DEFAULT_VALUE);
ws = new WsTester(new UserGroupsWs(new DeleteAction(db.getDbClient(), userSession, newGroupWsSupport(), settings, defaultOrganizationProvider)));
}
use of org.sonar.server.ws.WsTester in project sonarqube by SonarSource.
the class UsersWsTest method setUp.
@Before
public void setUp() {
WsTester tester = new WsTester(new UsersWs(new CreateAction(mock(UserUpdater.class), userSessionRule), new UpdateAction(mock(UserUpdater.class), userSessionRule, mock(UserJsonWriter.class), mock(DbClient.class)), new CurrentAction(userSessionRule, mock(DbClient.class), mock(DefaultOrganizationProvider.class)), new ChangePasswordAction(mock(DbClient.class), mock(UserUpdater.class), userSessionRule), new SearchAction(mock(UserIndex.class), mock(DbClient.class), mock(UserJsonWriter.class))));
controller = tester.controller("api/users");
}
Aggregations