Package org.springframework.boot.context.embedded

Examples of org.springframework.boot.context.embedded.MockEmbeddedServletContainerFactory$MockEmbeddedServletContainer


@Configuration
public class ExampleEmbeddedWebApplicationConfiguration {

  @Bean
  public EmbeddedServletContainerFactory containerFactory() {
    return new MockEmbeddedServletContainerFactory();
  }
View Full Code Here


    verifyContext();
    assertEquals(9000, getContainerFactory().getPort());
  }

  private void verifyContext() {
    MockEmbeddedServletContainerFactory containerFactory = getContainerFactory();
    Servlet servlet = this.context.getBean(
        DispatcherServletAutoConfiguration.DEFAULT_DISPATCHER_SERVLET_BEAN_NAME,
        Servlet.class);
    verify(containerFactory.getServletContext()).addServlet("dispatcherServlet",
        servlet);
  }
View Full Code Here

  @ConditionalOnExpression("true")
  public static class EmbeddedContainerConfiguration {

    @Bean
    public EmbeddedServletContainerFactory containerFactory() {
      return new MockEmbeddedServletContainerFactory();
    }
View Full Code Here

    @Override
    public Object postProcessBeforeInitialization(Object bean, String beanName)
        throws BeansException {
      if (bean instanceof ConfigurableEmbeddedServletContainer) {
        MockEmbeddedServletContainerFactory containerFactory = (MockEmbeddedServletContainerFactory) bean;
        assertNull(containerFactory.getServletContext());
      }
      return bean;
    }
View Full Code Here

    protected static MockEmbeddedServletContainerFactory containerFactory = null;

    @Bean
    public EmbeddedServletContainerFactory containerFactory() {
      if (containerFactory == null) {
        containerFactory = new MockEmbeddedServletContainerFactory();
      }
      return containerFactory;
    }
View Full Code Here

TOP

Related Classes of org.springframework.boot.context.embedded.MockEmbeddedServletContainerFactory$MockEmbeddedServletContainer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.