From 3e2ad28baf9f74450787cc8fcb804fb68fee3ce1 Mon Sep 17 00:00:00 2001 From: Kirill Likhodedov Date: Mon, 6 Feb 2017 12:03:18 +0000 Subject: [PATCH] git tests: don't override useful production method E.g. createNotification() handles the "empty content" situation. Override only the exact method to notify. --- .../src/com/intellij/openapi/vcs/VcsNotifier.java | 3 +-- .../com/intellij/openapi/vcs/TestVcsNotifier.java | 12 ------------ 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/VcsNotifier.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/VcsNotifier.java index 96c0fe770d92..1ab9ed084e97 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/VcsNotifier.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/VcsNotifier.java @@ -67,8 +67,7 @@ public class VcsNotifier { @NotNull NotificationType type, @Nullable NotificationListener listener) { Notification notification = createNotification(notificationGroup, title, message, type, listener); - notification.notify(myProject); - return notification; + return notify(notification); } @NotNull diff --git a/platform/vcs-tests/src/com/intellij/openapi/vcs/TestVcsNotifier.java b/platform/vcs-tests/src/com/intellij/openapi/vcs/TestVcsNotifier.java index 32a1db9a53f3..d8177a82c900 100644 --- a/platform/vcs-tests/src/com/intellij/openapi/vcs/TestVcsNotifier.java +++ b/platform/vcs-tests/src/com/intellij/openapi/vcs/TestVcsNotifier.java @@ -16,12 +16,8 @@ package com.intellij.openapi.vcs; import com.intellij.notification.Notification; -import com.intellij.notification.NotificationGroup; -import com.intellij.notification.NotificationListener; -import com.intellij.notification.NotificationType; import com.intellij.openapi.project.Project; import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; public class TestVcsNotifier extends VcsNotifier { @@ -37,14 +33,6 @@ public class TestVcsNotifier extends VcsNotifier { return myLastNotification; } - @Override - @NotNull - public Notification notify(@NotNull NotificationGroup notificationGroup, @NotNull String title, @NotNull String message, - @NotNull NotificationType type, @Nullable NotificationListener listener) { - myLastNotification = new Notification(TEST_NOTIFICATION_GROUP, title, message, type, listener); - return myLastNotification; - } - @NotNull public Notification notify(@NotNull Notification notification) { myLastNotification = notification;