org.springframework.boot.test

Class ServerPortInfoApplicationContextInitializer

  • All Implemented Interfaces:
    org.springframework.context.ApplicationContextInitializer<org.springframework.context.ConfigurableApplicationContext>

    Deprecated. 
    since 1.3 in favor of org.springframework.boot.context.web.ServerPortInfoApplicationContextInitializer

    @Deprecated
    public class ServerPortInfoApplicationContextInitializer
    extends ServerPortInfoApplicationContextInitializer
    ApplicationContextInitializer that sets Environment properties for the ports that EmbeddedServletContainer servers are actually listening on. The property "local.server.port" can be injected directly into tests using @Value or obtained via the Environment.

    If the EmbeddedWebApplicationContext has a namespace set, it will be used to construct the property name. For example, the "management" actuator context will have the property name "local.management.port".

    Properties are automatically propagated up to any parent context.

    Author:
    Dave Syer, Phillip Webb
    • Constructor Detail

      • ServerPortInfoApplicationContextInitializer

        public ServerPortInfoApplicationContextInitializer()
        Deprecated. 

Copyright © 2016 Pivotal Software, Inc.. All rights reserved.