1. 27 Feb, 2017 1 commit
    • Stephane Nicoll's avatar
      Add support for Mock test with WebFlux · c5595f29
      Stephane Nicoll authored
      This commit add mock support for WebFlux with an infrastructure similar
      to what `WebMvcTest` provides. `@WebFluxTest` can be used to test
      controllers with a narrowed classpath that is relevant to WebFlux. Also,
      `@SpringBootTest` now starts WebFlux in "mock" mode by default and
      `@AutoConfigureWebTestClient` can be used to inject a `WebTestClient`
      connected to the `ApplicationContext`.
      
      To make that happen, a `ReactiveWebApplicationContext` interface has been
      introduced to mirror what `WebApplicationContext` currently does. Things
      are still a bit volatile at this point and that infra may move to Spring
      Framework at some point.
      
      Closes gh-8401
      c5595f29
  2. 26 Feb, 2017 2 commits
  3. 24 Feb, 2017 15 commits
    • Brian Clozel's avatar
      Enable Tomcat, Jetty and Undertow reactive auto-conf · 3a8be10b
      Brian Clozel authored
      Closes gh-8403
      3a8be10b
    • Stephane Nicoll's avatar
      Hide javax.servlet.SessionTrackingMode · f1d4d843
      Stephane Nicoll authored
      The server's session can now be configured in both a servlet and a
      reactive environment. The latter has not requirement on the servlet API
      and this commit removes the requirement to the `SessionTrackingMode`
      enum.
      
      Closes gh-8402
      f1d4d843
    • Brian Clozel's avatar
      Fix typo in spring-webflux dependency · f12a6348
      Brian Clozel authored
      f12a6348
    • Brian Clozel's avatar
      Add missing dependency in docs generation · d1eafa29
      Brian Clozel authored
      Reactor Netty and Spring WebFlux were missing.
      d1eafa29
    • Stephane Nicoll's avatar
      Expose a WebTestClient with `@SpringBootTest` · 12397edb
      Stephane Nicoll authored
      This commit exposes a `WebTestClient` automatically in a reactive
      integration test that uses an embedded web server. This is similar to
      what we do with `TestRestTemplate` for servlet based integration tests.
      
      Closes gh-8399
      12397edb
    • Brian Clozel's avatar
      Add WebFlux application sample · c1e93d89
      Brian Clozel authored
      This commit adds a sample application for the
      annotation variant of Spring WebFlux.
      c1e93d89
    • Stephane Nicoll's avatar
      Start a reactive web application if necessary · 54939e8e
      Stephane Nicoll authored
      This commit makes sure that `@SpringBootTest` with a reactive setup
      starts a web application if necessary.
      
      If both a servlet and a reactive environment are available, a servlet
      environment is bootstraped. This commit also adds a way to force a
      reactive environment by specifying the `spring.main.web-application-type`
      property of the test (e.g. `@TestPropertySource`).
      
      Closes gh-8383
      54939e8e
    • Brian Clozel's avatar
      Add WebFlux auto-configuration · 8317977e
      Brian Clozel authored
      This commit creates auto-configuration classes for both the
      annotation and functional variants of the WebFlux framework.
      
      They provide the basic support to get started with those, by
      creating the required `HttpHandler` using the provided application
      context (for annotation) or `RouterFunction`s (for functional).
      
      They do support `WebFilter` registration and a few advanced
      features such as resource handling, `messageReaders|Writers`
      and `ViewResolver` auto-registration.
      
      Closes gh-8386
      8317977e
    • Brian Clozel's avatar
      Add support for reactive web servers auto-configuration · 656b509f
      Brian Clozel authored
      This commit adds the auto-configuration for creating reactive
      `EmbeddedWebServer` instances. This adds support for the
      following servers: Reactor Netty, Tomcat, Jetty and Undertow.
      
      Fixes gh-8302
      Fixes gh-8117
      656b509f
    • Brian Clozel's avatar
      Support reactive web servers with LocalServerPort · dc98d909
      Brian Clozel authored
      This commit refactors the `EmbeddedWebServerInitializedEvent` hierarchy
      to have one specialized event for Servlet based apps and another one for
      reactive apps.
      
      Each event implementation has:
      
      * a specific `ApplicationContext` implementation for the app
      * a custom `getServerId` implementation that differentiates the
      application server from the management server
      
      Closes gh-8348
      dc98d909
    • Brian Clozel's avatar
      Manage EmbeddedWebServer in ReactiveWebApplicationContext · 0b162e89
      Brian Clozel authored
      This commit adds an `EmbeddedWebServer` instance to the
      `ReactiveWebApplicationContext` and ties it to the application
      lifecycle.
      
      To launch a reactive web application, two elements are required
      from the context:
      
      * a `ReactiveWebServerFactory` to create a server instance
      * a `HttpHandler` instance to handle HTTP requests
      
      Closes gh-8337
      0b162e89
    • Brian Clozel's avatar
      Manage Netty in Boot dependencies · 21878f85
      Brian Clozel authored
      21878f85
    • Brian Clozel's avatar
      Add reactive web server infrastructure · f331ac13
      Brian Clozel authored
      This commit adds the infrastructure for creating and customizing
      reactive embedded web servers. Common configuration has been refactored
      into the new `ConfigurableEmbeddedWebServer` interface.
      
      See gh-8302
      f331ac13
    • Stephane Nicoll's avatar
      Merge branch '1.5.x' · a38d2456
      Stephane Nicoll authored
      a38d2456
    • Stephane Nicoll's avatar
      Avoid exposing several javax.validaton.Validator beans · 4aa99b95
      Stephane Nicoll authored
      This commit makes sure that the Spring `Validator` used by the MVC
      layer doesn't expose a JSR-303 contract, if any.
      
      The default implementation of the `mvcValidator` is
      `LocalValidatorFactoryBean`. While this object is exposed as a Spring
      `Validator` only, its runtime capabilities expose that contract as well
      as the standard `Validator` and `ValidatorFactory` ones.
      
      Concretely, if an auto-configuration is checking if a
      `javax.validation.Validator` bean is missing, the condition will match
      since we only know about "advertized types": beans haven't been created
      yet so we can't inspect their runtime capabilities. Since the condition
      match, we will auto-configure a bean. At runtime though, we're no longer
      ale to inject a `javax.validation.Validator` by type since two candidates
      are available.
      
      This commit introduces `SpringValidatorAdapterWrapper`, a wrapper class
      on any `SpringValidatorAdapter` (`LocalValidatorFactoryBean` being one of
      the available implementations) that only exposes the Spring contract.
      
      Also, if a `javax.validation.Validator` bean is available, we will use it
      for the MVC layer, rather than creating a new one.
      
      Closes gh-8223
      4aa99b95
  4. 22 Feb, 2017 22 commits