Search in sources :

Example 16 with MyNewIssuesNotification

use of org.sonar.server.issue.notification.MyNewIssuesNotification in project sonarqube by SonarSource.

the class NotificationFactoryTest method newMyNewIssuesNotification_DetailsSupplier_getRuleDefinitionByRuleKey_always_returns_empty_if_RuleRepository_is_empty.

@Test
public void newMyNewIssuesNotification_DetailsSupplier_getRuleDefinitionByRuleKey_always_returns_empty_if_RuleRepository_is_empty() {
    MyNewIssuesNotification underTest = this.underTest.newMyNewIssuesNotification(emptyMap());
    DetailsSupplier detailsSupplier = readDetailsSupplier(underTest);
    assertThat(detailsSupplier.getRuleDefinitionByRuleKey(RuleKey.of("foo", "bar"))).isEmpty();
    assertThat(detailsSupplier.getRuleDefinitionByRuleKey(RuleKey.of("bar", "foo"))).isEmpty();
}
Also used : MyNewIssuesNotification(org.sonar.server.issue.notification.MyNewIssuesNotification) DetailsSupplier(org.sonar.server.issue.notification.NewIssuesNotification.DetailsSupplier) Test(org.junit.Test)

Aggregations

MyNewIssuesNotification (org.sonar.server.issue.notification.MyNewIssuesNotification)16 Test (org.junit.Test)13 DetailsSupplier (org.sonar.server.issue.notification.NewIssuesNotification.DetailsSupplier)11 UserDto (org.sonar.db.user.UserDto)4 Date (java.util.Date)3 Map (java.util.Map)3 RuleKey (org.sonar.api.rule.RuleKey)3 ImmutableMap (com.google.common.collect.ImmutableMap)2 ImmutableSet (com.google.common.collect.ImmutableSet)2 Random (java.util.Random)2 Set (java.util.Set)2 IntStream (java.util.stream.IntStream)2 Stream (java.util.stream.Stream)2 Assertions.assertThat (org.assertj.core.api.Assertions.assertThat)2 Rule (org.junit.Rule)2 ArgumentCaptor (org.mockito.ArgumentCaptor)2 DataProvider (com.tngtech.java.junit.dataprovider.DataProvider)1 DataProviderRunner (com.tngtech.java.junit.dataprovider.DataProviderRunner)1 UseDataProvider (com.tngtech.java.junit.dataprovider.UseDataProvider)1 IOException (java.io.IOException)1