use of org.sonarsource.sonarlint.core.client.api.notifications.SonarQubeNotificationListener in project sonarlint-core by SonarSource.
the class SonarQubeNotificationsTest method testRegistration.
@Test
public void testRegistration() {
SonarQubeNotificationListener listener = mock(SonarQubeNotificationListener.class);
when(config.listener()).thenReturn(listener);
SonarQubeNotifications notifications = new SonarQubeNotifications(timer, timerTask, checkerFactory);
notifications.register(config);
notifications.remove(listener);
verify(timerTask, times(2)).setProjects(anyCollection());
verifyNoMoreInteractions(timerTask);
verify(timer).scheduleAtFixedRate(timerTask, SonarQubeNotifications.DELAY, SonarQubeNotifications.DELAY);
}
use of org.sonarsource.sonarlint.core.client.api.notifications.SonarQubeNotificationListener in project sonarlint-core by SonarSource.
the class NotificationConfigurationTest method testGetters.
@Test
public void testGetters() {
SonarQubeNotificationListener listener = mock(SonarQubeNotificationListener.class);
LastNotificationTime lastNotificationTime = mock(LastNotificationTime.class);
String projectKey = "key";
ServerConfiguration serverConfiguration = mock(ServerConfiguration.class);
NotificationConfiguration configuration = new NotificationConfiguration(listener, lastNotificationTime, projectKey, serverConfiguration);
assertThat(configuration.lastNotificationTime()).isEqualTo(lastNotificationTime);
assertThat(configuration.listener()).isEqualTo(listener);
assertThat(configuration.projectKey()).isEqualTo(projectKey);
assertThat(configuration.serverConfiguration()).isEqualTo(serverConfiguration);
}
Aggregations