Search in sources :

Example 6 with ComponentFinder

use of org.sonar.server.component.ComponentFinder in project sonarqube by SonarSource.

the class SearchActionTest method setUp.

@Before
public void setUp() {
    ComponentFinder componentFinder = new ComponentFinder(dbClient);
    underTest = new SearchAction(dbClient, userSession, componentFinder);
    ws = new WsActionTester(underTest);
}
Also used : ComponentFinder(org.sonar.server.component.ComponentFinder) WsActionTester(org.sonar.server.ws.WsActionTester) Before(org.junit.Before)

Example 7 with ComponentFinder

use of org.sonar.server.component.ComponentFinder 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));
}
Also used : ComponentFinder(org.sonar.server.component.ComponentFinder) QProfileFactory(org.sonar.server.qualityprofile.QProfileFactory) Languages(org.sonar.api.resources.Languages) WsActionTester(org.sonar.server.ws.WsActionTester) QProfileLookup(org.sonar.server.qualityprofile.QProfileLookup) Before(org.junit.Before)

Example 8 with ComponentFinder

use of org.sonar.server.component.ComponentFinder in project sonarqube by SonarSource.

the class LinesActionTest method setUp.

@Before
public void setUp() {
    htmlSourceDecorator = mock(HtmlSourceDecorator.class);
    when(htmlSourceDecorator.getDecoratedSourceAsHtml(anyString(), anyString(), anyString())).then(new Answer<String>() {

        @Override
        public String answer(InvocationOnMock invocationOnMock) throws Throwable {
            return "<p>" + invocationOnMock.getArguments()[0] + "</p>";
        }
    });
    sourceService = new SourceService(dbTester.getDbClient(), htmlSourceDecorator);
    componentDao = new ComponentDao();
    wsTester = new WsTester(new SourcesWs(new LinesAction(new ComponentFinder(dbTester.getDbClient()), dbTester.getDbClient(), sourceService, htmlSourceDecorator, userSessionRule)));
}
Also used : ComponentFinder(org.sonar.server.component.ComponentFinder) HtmlSourceDecorator(org.sonar.server.source.HtmlSourceDecorator) WsTester(org.sonar.server.ws.WsTester) InvocationOnMock(org.mockito.invocation.InvocationOnMock) Matchers.anyString(org.mockito.Matchers.anyString) SourceService(org.sonar.server.source.SourceService) ComponentDao(org.sonar.db.component.ComponentDao) Before(org.junit.Before)

Example 9 with ComponentFinder

use of org.sonar.server.component.ComponentFinder in project sonarqube by SonarSource.

the class WebhookDeliveriesActionTest method setUp.

@Before
public void setUp() {
    ComponentFinder componentFinder = new ComponentFinder(dbClient);
    WebhookDeliveriesAction underTest = new WebhookDeliveriesAction(dbClient, userSession, componentFinder);
    ws = new WsActionTester(underTest);
    project = db.components().insertComponent(newProjectDto(db.organizations().insert()).setKey("my-project"));
}
Also used : ComponentFinder(org.sonar.server.component.ComponentFinder) WsActionTester(org.sonar.server.ws.WsActionTester) Before(org.junit.Before)

Example 10 with ComponentFinder

use of org.sonar.server.component.ComponentFinder in project sonarqube by SonarSource.

the class WebhookDeliveryActionTest method setUp.

@Before
public void setUp() {
    ComponentFinder componentFinder = new ComponentFinder(dbClient);
    WebhookDeliveryAction underTest = new WebhookDeliveryAction(dbClient, userSession, componentFinder);
    ws = new WsActionTester(underTest);
    project = db.components().insertComponent(newProjectDto(db.organizations().insert()).setKey("my-project"));
}
Also used : ComponentFinder(org.sonar.server.component.ComponentFinder) WsActionTester(org.sonar.server.ws.WsActionTester) Before(org.junit.Before)

Aggregations

ComponentFinder (org.sonar.server.component.ComponentFinder)24 Before (org.junit.Before)23 WsActionTester (org.sonar.server.ws.WsActionTester)13 WsTester (org.sonar.server.ws.WsTester)11 NotificationChannel (org.sonar.api.notifications.NotificationChannel)2 UserDto (org.sonar.db.user.UserDto)2 NotificationCenter (org.sonar.server.notification.NotificationCenter)2 NotificationDispatcherMetadata (org.sonar.server.notification.NotificationDispatcherMetadata)2 NotificationUpdater (org.sonar.server.notification.NotificationUpdater)2 UserJsonWriter (org.sonar.server.user.ws.UserJsonWriter)2 Matchers.anyString (org.mockito.Matchers.anyString)1 InvocationOnMock (org.mockito.invocation.InvocationOnMock)1 I18n (org.sonar.api.i18n.I18n)1 Languages (org.sonar.api.resources.Languages)1 Page (org.sonar.api.web.page.Page)1 PluginRepository (org.sonar.core.platform.PluginRepository)1 DbClient (org.sonar.db.DbClient)1 ComponentDao (org.sonar.db.component.ComponentDao)1 IssueIndex (org.sonar.server.issue.index.IssueIndex)1 AuthorizationTypeSupport (org.sonar.server.permission.index.AuthorizationTypeSupport)1