Search in sources :

Example 1 with SourceService

use of org.sonar.server.source.SourceService 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)

Aggregations

Before (org.junit.Before)1 Matchers.anyString (org.mockito.Matchers.anyString)1 InvocationOnMock (org.mockito.invocation.InvocationOnMock)1 ComponentDao (org.sonar.db.component.ComponentDao)1 ComponentFinder (org.sonar.server.component.ComponentFinder)1 HtmlSourceDecorator (org.sonar.server.source.HtmlSourceDecorator)1 SourceService (org.sonar.server.source.SourceService)1 WsTester (org.sonar.server.ws.WsTester)1