Example usage for org.springframework.boot.test.context DefaultTestExecutionListenersPostProcessor postProcessDefaultTestExecutionListeners

List of usage examples for org.springframework.boot.test.context DefaultTestExecutionListenersPostProcessor postProcessDefaultTestExecutionListeners

Introduction

In this page you can find the example usage for org.springframework.boot.test.context DefaultTestExecutionListenersPostProcessor postProcessDefaultTestExecutionListeners.

Prototype

Set<Class<? extends TestExecutionListener>> postProcessDefaultTestExecutionListeners(
        Set<Class<? extends TestExecutionListener>> listeners);

Source Link

Document

Post process the list of default TestExecutionListener classes to be used.

Usage

From source file:org.springframework.boot.test.context.SpringBootTestContextBootstrapper.java

@Override
protected Set<Class<? extends TestExecutionListener>> getDefaultTestExecutionListenerClasses() {
    Set<Class<? extends TestExecutionListener>> listeners = super.getDefaultTestExecutionListenerClasses();
    List<DefaultTestExecutionListenersPostProcessor> postProcessors = SpringFactoriesLoader
            .loadFactories(DefaultTestExecutionListenersPostProcessor.class, getClass().getClassLoader());
    for (DefaultTestExecutionListenersPostProcessor postProcessor : postProcessors) {
        listeners = postProcessor.postProcessDefaultTestExecutionListeners(listeners);
    }/*from ww  w.  j av  a 2s. c  o m*/
    return listeners;
}