use of com.intellij.notification.NotificationsAdapter in project intellij-community by JetBrains.
the class TaskManagerTest method testNotifications.
public void testNotifications() throws Exception {
final Ref<Notification> notificationRef = new Ref<>();
getProject().getMessageBus().connect(myFixture.getTestRootDisposable()).subscribe(Notifications.TOPIC, new NotificationsAdapter() {
@Override
public void notify(@NotNull Notification notification) {
notificationRef.set(notification);
}
});
TestRepository repository = new TestRepository() {
@Override
public Task[] getIssues(@Nullable String query, int max, long since) throws Exception {
throw new Exception();
}
};
myTaskManager.setRepositories(Collections.singletonList(repository));
myTaskManager.updateIssues(null);
assertNull(notificationRef.get());
myTaskManager.getIssues("");
assertNotNull(notificationRef.get());
}
Aggregations