Search in sources :

Example 61 with WsTester

use of org.sonar.server.ws.WsTester in project sonarqube by SonarSource.

the class RenameActionTest method setUp.

@Before
public void setUp() {
    createProfiles();
    tester = new WsTester(new QProfilesWs(mock(RuleActivationActions.class), mock(BulkRuleActivationActions.class), new RenameAction(new QProfileFactory(dbClient, defaultOrganizationProvider), wsSupport)));
}
Also used : QProfileFactory(org.sonar.server.qualityprofile.QProfileFactory) WsTester(org.sonar.server.ws.WsTester) Before(org.junit.Before)

Example 62 with WsTester

use of org.sonar.server.ws.WsTester in project sonarqube by SonarSource.

the class HashActionTest method before.

@Before
public void before() {
    DbClient dbClient = db.getDbClient();
    tester = new WsTester(new SourcesWs(new HashAction(dbClient, userSessionRule, new ComponentFinder(dbClient))));
}
Also used : ComponentFinder(org.sonar.server.component.ComponentFinder) DbClient(org.sonar.db.DbClient) WsTester(org.sonar.server.ws.WsTester) Before(org.junit.Before)

Example 63 with WsTester

use of org.sonar.server.ws.WsTester in project sonarqube by SonarSource.

the class IndexActionTest method setUp.

@Before
public void setUp() {
    when(dbClient.componentDao()).thenReturn(componentDao);
    when(dbClient.openSession(false)).thenReturn(session);
    tester = new WsTester(new SourcesWs(new IndexAction(dbClient, sourceService, userSessionRule, new ComponentFinder(dbClient))));
}
Also used : ComponentFinder(org.sonar.server.component.ComponentFinder) WsTester(org.sonar.server.ws.WsTester) Before(org.junit.Before)

Example 64 with WsTester

use of org.sonar.server.ws.WsTester in project sonarqube by SonarSource.

the class RawActionTest method setUp.

@Before
public void setUp() {
    when(dbClient.componentDao()).thenReturn(componentDao);
    when(dbClient.openSession(false)).thenReturn(session);
    tester = new WsTester(new SourcesWs(new RawAction(dbClient, sourceService, userSessionRule, new ComponentFinder(dbClient))));
}
Also used : ComponentFinder(org.sonar.server.component.ComponentFinder) WsTester(org.sonar.server.ws.WsTester) Before(org.junit.Before)

Example 65 with WsTester

use of org.sonar.server.ws.WsTester in project sonarqube by SonarSource.

the class ShowActionTest method setUp.

@Before
public void setUp() {
    when(dbClient.componentDao()).thenReturn(componentDao);
    when(dbClient.openSession(false)).thenReturn(session);
    tester = new WsTester(new SourcesWs(new ShowAction(sourceService, dbClient, userSessionRule, new ComponentFinder(dbClient))));
}
Also used : ComponentFinder(org.sonar.server.component.ComponentFinder) WsTester(org.sonar.server.ws.WsTester) Before(org.junit.Before)

Aggregations

WsTester (org.sonar.server.ws.WsTester)71 Before (org.junit.Before)50 Test (org.junit.Test)21 DbClient (org.sonar.db.DbClient)18 ComponentFinder (org.sonar.server.component.ComponentFinder)15 WebService (org.sonar.api.server.ws.WebService)12 UserSession (org.sonar.server.user.UserSession)5 Languages (org.sonar.api.resources.Languages)4 QProfileFactory (org.sonar.server.qualityprofile.QProfileFactory)4 UserDto (org.sonar.db.user.UserDto)3 DefaultOrganizationProvider (org.sonar.server.organization.DefaultOrganizationProvider)3 UserJsonWriter (org.sonar.server.user.ws.UserJsonWriter)3 I18n (org.sonar.api.i18n.I18n)2 System2 (org.sonar.api.utils.System2)2 OrganizationDao (org.sonar.db.organization.OrganizationDao)2 RuleRepositoryDto (org.sonar.db.rule.RuleRepositoryDto)2 DefaultOrganization (org.sonar.server.organization.DefaultOrganization)2 UserUpdater (org.sonar.server.user.UserUpdater)2 UserIndex (org.sonar.server.user.index.UserIndex)2 Locale (java.util.Locale)1