diff --git a/allure-junit4-aspect/src/main/java/io/qameta/allure/junit4/aspect/AllureJunit4ListenerAspect.java b/allure-junit4-aspect/src/main/java/io/qameta/allure/junit4/aspect/AllureJunit4ListenerAspect.java index da9e0353..bd351e30 100644 --- a/allure-junit4-aspect/src/main/java/io/qameta/allure/junit4/aspect/AllureJunit4ListenerAspect.java +++ b/allure-junit4-aspect/src/main/java/io/qameta/allure/junit4/aspect/AllureJunit4ListenerAspect.java @@ -32,8 +32,8 @@ public class AllureJunit4ListenerAspect { @After("execution(org.junit.runner.notification.RunNotifier.new())") public void addListener(final JoinPoint point) { final RunNotifier notifier = (RunNotifier) point.getThis(); - notifier.removeListener(allure); - notifier.addListener(allure); + if (RunNotifier.class.equals(notifier.getClass())) { + notifier.addListener(allure); + } } - }