void () { final Ref<Notification> notificationRef = new Ref<>(); getProject().getMessageBus().connect(getTestRootDisposable()).subscribe(Notifications.TOPIC, new Notifications() { @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()); TaskSearchSupport.getRepositoriesTasks(getProject(), "", 0, 100, true, false, new EmptyProgressIndicator()); assertNotNull(notificationRef.get()); }