Search in sources :

Example 16 with ComponentFinder

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

the class MetricsActionTest method setUp.

@Before
public void setUp() throws Exception {
    es.putDocuments(UserIndexDefinition.INDEX_TYPE_USER.getIndex(), UserIndexDefinition.INDEX_TYPE_USER.getType(), new UserDoc().setLogin("login").setName("Login").setEmail("login@login.com").setActive(true));
    ws = new WsTester(new CustomMeasuresWs(new MetricsAction(dbClient, userSession, new ComponentFinder(dbClient))));
    defaultProject = insertDefaultProject();
    userSession.logIn().addProjectUuidPermissions(UserRole.ADMIN, defaultProject.uuid());
}
Also used : ComponentFinder(org.sonar.server.component.ComponentFinder) WsTester(org.sonar.server.ws.WsTester) UserDoc(org.sonar.server.user.index.UserDoc) Before(org.junit.Before)

Example 17 with ComponentFinder

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

the class RemoveActionTest method setUp.

@Before
public void setUp() {
    NotificationDispatcherMetadata metadata1 = NotificationDispatcherMetadata.create(NOTIF_MY_NEW_ISSUES).setProperty(GLOBAL_NOTIFICATION, "true").setProperty(PER_PROJECT_NOTIFICATION, "true");
    NotificationDispatcherMetadata metadata2 = NotificationDispatcherMetadata.create(NOTIF_NEW_ISSUES).setProperty(GLOBAL_NOTIFICATION, "true");
    NotificationDispatcherMetadata metadata3 = NotificationDispatcherMetadata.create(NOTIF_NEW_QUALITY_GATE_STATUS).setProperty(GLOBAL_NOTIFICATION, "true").setProperty(PER_PROJECT_NOTIFICATION, "true");
    notificationCenter = new NotificationCenter(new NotificationDispatcherMetadata[] { metadata1, metadata2, metadata3 }, new NotificationChannel[] { emailChannel, twitterChannel, defaultChannel });
    notificationUpdater = new NotificationUpdater(userSession, dbClient);
    underTest = new RemoveAction(notificationCenter, notificationUpdater, dbClient, new ComponentFinder(dbClient), userSession);
    ws = new WsActionTester(underTest);
}
Also used : NotificationChannel(org.sonar.api.notifications.NotificationChannel) ComponentFinder(org.sonar.server.component.ComponentFinder) NotificationCenter(org.sonar.server.notification.NotificationCenter) NotificationDispatcherMetadata(org.sonar.server.notification.NotificationDispatcherMetadata) NotificationUpdater(org.sonar.server.notification.NotificationUpdater) WsActionTester(org.sonar.server.ws.WsActionTester) Before(org.junit.Before)

Example 18 with ComponentFinder

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

the class CreateActionTest method setUp.

@Before
public void setUp() {
    ComponentFinder componentFinder = new ComponentFinder(dbClient);
    underTest = new CreateAction(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 19 with ComponentFinder

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

the class ProjectStatusActionTest method setUp.

@Before
public void setUp() {
    dbClient = db.getDbClient();
    dbSession = db.getSession();
    ws = new WsActionTester(new ProjectStatusAction(dbClient, new ComponentFinder(dbClient), userSession));
}
Also used : ComponentFinder(org.sonar.server.component.ComponentFinder) WsActionTester(org.sonar.server.ws.WsActionTester) Before(org.junit.Before)

Example 20 with ComponentFinder

use of org.sonar.server.component.ComponentFinder 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)

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