void () { MessageBusConnection connection = myFixture.getProject().getMessageBus().connect(); Disposer.register(myFixture.getTestRootDisposable(), connection); RefactoringEventListener listener = mock(RefactoringEventListener.class); connection.subscribe(RefactoringEventListener.REFACTORING_EVENT_TOPIC, listener); doUndoRedoRenameClass("foo.AnotherTestClass", "AnotherTestClass1"); verify(listener).refactoringDone(any(String.class), any(RefactoringEventData.class)); verify(listener).undoRefactoring(any(String.class)); verify(listener).redoRefactoring(any(String.class)); }