diff --git a/test-frame-common/src/main/java/io/skodjob/testframe/listeners/TestVisualSeparatorExtension.java b/test-frame-common/src/main/java/io/skodjob/testframe/listeners/TestVisualSeparatorExtension.java index 383de14..4d699e9 100644 --- a/test-frame-common/src/main/java/io/skodjob/testframe/listeners/TestVisualSeparatorExtension.java +++ b/test-frame-common/src/main/java/io/skodjob/testframe/listeners/TestVisualSeparatorExtension.java @@ -5,7 +5,9 @@ package io.skodjob.testframe.listeners; import io.skodjob.testframe.utils.LoggerUtils; +import org.junit.jupiter.api.extension.AfterAllCallback; import org.junit.jupiter.api.extension.AfterEachCallback; +import org.junit.jupiter.api.extension.BeforeAllCallback; import org.junit.jupiter.api.extension.BeforeEachCallback; import org.junit.jupiter.api.extension.ExtensionContext; import org.slf4j.Logger; @@ -14,23 +16,36 @@ /** * jUnit5 specific class which listening on test callbacks */ -public class TestVisualSeparatorExtension implements BeforeEachCallback, AfterEachCallback { +public class TestVisualSeparatorExtension implements BeforeEachCallback, AfterEachCallback, + BeforeAllCallback, AfterAllCallback { private final Logger logger = LoggerFactory.getLogger(TestVisualSeparatorExtension.class); private TestVisualSeparatorExtension() { // Private constructor to prevent instantiation } + @Override + public void beforeAll(ExtensionContext extensionContext) { + LoggerUtils.logSeparator(); + logger.info("TestClass {} STARTED", extensionContext.getRequiredTestClass().getName()); + } + + @Override + public void afterAll(ExtensionContext extensionContext) { + logger.info("TestClass {} FINISHED", extensionContext.getRequiredTestClass().getName()); + LoggerUtils.logSeparator(); + } + @Override public void beforeEach(ExtensionContext extensionContext) { LoggerUtils.logSeparator(); - logger.info("{}.{}-STARTED", extensionContext.getRequiredTestClass().getName(), + logger.info("Test {}.{} STARTED", extensionContext.getRequiredTestClass().getName(), extensionContext.getDisplayName().replace("()", "")); } @Override public void afterEach(ExtensionContext extensionContext) { - logger.info("{}.{}-FINISHED", extensionContext.getRequiredTestClass().getName(), + logger.info("Test {}.{} FINISHED", extensionContext.getRequiredTestClass().getName(), extensionContext.getDisplayName().replace("()", "")); LoggerUtils.logSeparator(); }