use of org.sonar.server.ws.WsTester in project sonarqube by SonarSource.
the class ComponentsWsTest method setUp.
@Before
public void setUp() {
Languages languages = mock(Languages.class, RETURNS_DEEP_STUBS);
when(languages.all()).thenReturn(new Language[0]);
WsTester tester = new WsTester(new ComponentsWs(new AppAction(mock(DbClient.class), userSessionRule, mock(ComponentFinder.class)), new SuggestionsAction(mock(DbClient.class), mock(ComponentIndex.class)), new SearchAction(mock(DbClient.class), mock(ResourceTypes.class), mock(I18n.class), userSessionRule, languages, TestDefaultOrganizationProvider.fromUuid("foo"))));
controller = tester.controller("api/components");
}
use of org.sonar.server.ws.WsTester in project sonarqube by SonarSource.
the class SearchActionComponentsMediumTest method setUp.
@Before
public void setUp() {
tester.clearDbAndIndexes();
db = tester.get(DbClient.class);
wsTester = tester.get(WsTester.class);
session = db.openSession(false);
OrganizationDao organizationDao = db.organizationDao();
DefaultOrganization defaultOrganization = tester.get(DefaultOrganizationProvider.class).get();
this.defaultOrganization = organizationDao.selectByUuid(session, defaultOrganization.getUuid()).get();
this.otherOrganization1 = OrganizationTesting.newOrganizationDto().setKey("my-org-1");
this.otherOrganization2 = OrganizationTesting.newOrganizationDto().setKey("my-org-2");
organizationDao.insert(session, this.otherOrganization1);
organizationDao.insert(session, this.otherOrganization2);
session.commit();
}
use of org.sonar.server.ws.WsTester in project sonarqube by SonarSource.
the class ComponentTagsActionTest method setUp.
@Before
public void setUp() {
componentTagsAction = new ComponentTagsAction(service, queryService);
tester = new WsTester(new IssuesWs(componentTagsAction));
}
use of org.sonar.server.ws.WsTester in project sonarqube by SonarSource.
the class SearchActionMediumTest method setUp.
@Before
public void setUp() {
tester.clearDbAndIndexes();
db = tester.get(DbClient.class);
wsTester = tester.get(WsTester.class);
session = db.openSession(false);
OrganizationDao organizationDao = db.organizationDao();
DefaultOrganization defaultOrganization = tester.get(DefaultOrganizationProvider.class).get();
this.defaultOrganization = organizationDao.selectByUuid(session, defaultOrganization.getUuid()).get();
this.otherOrganization1 = OrganizationTesting.newOrganizationDto().setKey("my-org-1");
this.otherOrganization2 = OrganizationTesting.newOrganizationDto().setKey("my-org-2");
organizationDao.insert(session, this.otherOrganization1);
organizationDao.insert(session, this.otherOrganization2);
session.commit();
}
use of org.sonar.server.ws.WsTester in project sonarqube by SonarSource.
the class CustomMeasuresWsTest method setUp.
@Before
public void setUp() {
DbClient dbClient = mock(DbClient.class);
UserSession userSession = mock(UserSession.class);
ws = new WsTester(new CustomMeasuresWs(new DeleteAction(dbClient, userSession), new CreateAction(dbClient, userSession, System2.INSTANCE, mock(CustomMeasureValidator.class), mock(CustomMeasureJsonWriter.class), mock(ComponentFinder.class)), new UpdateAction(dbClient, userSession, System2.INSTANCE, mock(CustomMeasureValidator.class), mock(CustomMeasureJsonWriter.class))));
}
Aggregations