use of org.sonar.db.property.PropertiesDao in project sonarqube by SonarSource.
the class NotificationDaemonTest method hasProjectSubscribersForType.
@Test
public void hasProjectSubscribersForType() {
setUpMocks();
PropertiesDao dao = mock(PropertiesDao.class);
when(dbClient.propertiesDao()).thenReturn(dao);
// no subscribers
when(dao.hasProjectNotificationSubscribersForDispatchers("PROJECT_UUID", Arrays.asList("CommentOnIssueAssignedToMe", "CommentOnIssueCreatedByMe"))).thenReturn(false);
assertThat(service.hasProjectSubscribersForTypes("PROJECT_UUID", Sets.newHashSet("issue-changes"))).isFalse();
// has subscribers on one dispatcher (among the two)
when(dao.hasProjectNotificationSubscribersForDispatchers("PROJECT_UUID", Arrays.asList("CommentOnIssueAssignedToMe", "CommentOnIssueCreatedByMe"))).thenReturn(true);
assertThat(service.hasProjectSubscribersForTypes("PROJECT_UUID", Sets.newHashSet("issue-changes"))).isTrue();
}
use of org.sonar.db.property.PropertiesDao in project sonarqube by SonarSource.
the class RenameDeprecatedPropertyKeysTest method should_rename_deprecated_keys.
@Test
public void should_rename_deprecated_keys() {
PropertiesDao dao = mock(PropertiesDao.class);
PropertyDefinitions definitions = new PropertyDefinitions(FakeExtension.class);
RenameDeprecatedPropertyKeys task = new RenameDeprecatedPropertyKeys(dao, definitions);
task.start();
verify(dao).renamePropertyKey("old_key", "new_key");
verifyNoMoreInteractions(dao);
}
Aggregations