aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-core/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'sonar-core/src/test')
-rw-r--r--sonar-core/src/test/java/org/sonar/core/notifications/DefaultNotificationManagerTest.java7
-rw-r--r--sonar-core/src/test/resources/org/sonar/core/notifications/DefaultNotificationManagerTest/fixture.xml8
2 files changed, 15 insertions, 0 deletions
diff --git a/sonar-core/src/test/java/org/sonar/core/notifications/DefaultNotificationManagerTest.java b/sonar-core/src/test/java/org/sonar/core/notifications/DefaultNotificationManagerTest.java
index 70587fa8493..ae661ae43cc 100644
--- a/sonar-core/src/test/java/org/sonar/core/notifications/DefaultNotificationManagerTest.java
+++ b/sonar-core/src/test/java/org/sonar/core/notifications/DefaultNotificationManagerTest.java
@@ -49,4 +49,11 @@ public class DefaultNotificationManagerTest extends AbstractDbUnitTestCase {
assertThat(manager.getFromQueue(), nullValue());
}
+ @Test
+ public void shouldCheckEnablement() {
+ setupData("fixture");
+ assertThat(manager.isEnabled("simon", "email", "CommentOnReviewAssignedToMe"), is(true));
+ assertThat(manager.isEnabled("godin", "email", "CommentOnReviewAssignedToMe"), is(false));
+ }
+
}
diff --git a/sonar-core/src/test/resources/org/sonar/core/notifications/DefaultNotificationManagerTest/fixture.xml b/sonar-core/src/test/resources/org/sonar/core/notifications/DefaultNotificationManagerTest/fixture.xml
new file mode 100644
index 00000000000..7933d24446d
--- /dev/null
+++ b/sonar-core/src/test/resources/org/sonar/core/notifications/DefaultNotificationManagerTest/fixture.xml
@@ -0,0 +1,8 @@
+<dataset>
+
+ <users id="1" login="simon" />
+ <users id="2" login="godin" />
+
+ <properties user_id="1" prop_key="notification.CommentOnReviewAssignedToMe.email" text_value="true"/>
+
+</dataset> \ No newline at end of file