Example usage for org.springframework.boot.web.servlet.context AnnotationConfigServletWebServerApplicationContext refresh

List of usage examples for org.springframework.boot.web.servlet.context AnnotationConfigServletWebServerApplicationContext refresh

Introduction

In this page you can find the example usage for org.springframework.boot.web.servlet.context AnnotationConfigServletWebServerApplicationContext refresh.

Prototype

@Override
    public final void refresh() throws BeansException, IllegalStateException 

Source Link

Usage

From source file:org.springframework.boot.actuate.autoconfigure.metrics.PublicMetricsAutoConfigurationTests.java

private void loadWeb(Class<?>... config) {
    AnnotationConfigServletWebServerApplicationContext context = new AnnotationConfigServletWebServerApplicationContext();
    if (config.length > 0) {
        context.register(config);/* w  ww .j  ava2 s  .c om*/
    }
    context.register(DataSourcePoolMetadataProvidersConfiguration.class, CacheStatisticsAutoConfiguration.class,
            PublicMetricsAutoConfiguration.class, MockServletWebServerFactory.class);
    context.refresh();
    this.context = context;
}