* 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
35 lines
1.1 KiB
Java
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;
|
|
}
|
|
}
|