org.springframework.boot.test

Annotation Type WebIntegrationTest



  • @Documented
     @Inherited
     @Retention(value=RUNTIME)
     @Target(value=TYPE)
     @BootstrapWith(value=org.springframework.boot.test.WebAppIntegrationTestContextBootstrapper.class)
    public @interface WebIntegrationTest
    Test class annotation signifying that the tests are "web integration tests" and therefore require full startup in the same way as a production application (listening on normal ports). Normally used in conjunction with @SpringApplicationConfiguration,

    This annotation can be used as an alternative to @IntegrationTest and @WebAppConfiguration.

    Since:
    1.2.1
    Author:
    Phillip Webb
    See Also:
    IntegrationTest
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element and Description
      boolean randomPort
      Convenience attribute that can be used to set a server.port=0 Environment property which usually triggers listening on a random port.
      String[] value
      Properties in form key=value that should be added to the Spring Environment before the test runs.
    • Element Detail

      • value

        public abstract String[] value
        Properties in form key=value that should be added to the Spring Environment before the test runs.
        Returns:
        properties to add to the context
        Default:
        {}
      • randomPort

        public abstract boolean randomPort
        Convenience attribute that can be used to set a server.port=0 Environment property which usually triggers listening on a random port. Often used in conjunction with a @Value("${local.server.port}") injected field on the test.
        Returns:
        if a random port should be used
        Default:
        false

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