Files
spring-boot-rest/testing-modules/junit-5/src/test/java/com/baeldung/extensions/RegisterExtensionSampleExtension.java
Binod Pant 39b0b845cf BAEL-1527 (#4398)
* commit first as binodpanta

* revert test change

* A short example of real-time event streaming using Spring WebFlux

* Code for http://jira.baeldung.com/browse/BAEL-1527

* remove unrelated files

* Apply feedback changes to rename test and remove link from readme file, ongoing work

* Update formatting fixes to code and add pom changes, that partially fix test runnning issues in IDE but not in cmdline

* Apply Eclipse formatter to test code and apply suggested pom fixes

* BAEL-1527 Formatting fix in pom.xml

* Use string.format to cleanup logging code

* BAEL-1527 Changed logging pattern
2018-06-04 18:38:30 +02:00

35 lines
1.1 KiB
Java

package com.baeldung.extensions;
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;
import org.slf4j.LoggerFactory;
/**
* This extension is meant to demonstrate the use of RegisterExtension.
*/
public class RegisterExtensionSampleExtension implements BeforeAllCallback, BeforeEachCallback {
private final String type;
Logger logger = LoggerFactory.getLogger(RegisterExtensionSampleExtension.class);
public RegisterExtensionSampleExtension(String type) {
this.type = type;
}
@Override
public void beforeAll(ExtensionContext extensionContext) throws Exception {
logger.info("Type {} In beforeAll : {}", type, extensionContext.getDisplayName());
}
@Override
public void beforeEach(ExtensionContext extensionContext) throws Exception {
logger.info("Type {} In beforeEach : {}", type, extensionContext.getDisplayName());
}
public String getType() {
return type;
}
}