1. 17 8月, 2019 1 次提交
    • S
      Migrate parameterized tests in spring-core · 3df85c78
      Sam Brannen 提交于
      This commit migrates parameterized tests in spring-core using the
      "composed @ParameterizedTest" approach. This approach is reused in
      follow-up commits for the migration of the remaining modules.
      
      For a concrete example, see AbstractDataBufferAllocatingTests and its
      subclasses (e.g., DataBufferTests).
      
      Specifically, AbstractDataBufferAllocatingTests declares a custom
      @ParameterizedDataBufferAllocatingTest annotation that is
      meta-annotated with @ParameterizedTest and
      @MethodSource("org.springframework.core.io.buffer.AbstractDataBufferAllocatingTests#dataBufferFactories()").
      
      Individual methods in concrete subclasses are then annotated with
      @ParameterizedDataBufferAllocatingTest instead of @ParameterizedTest or
      @test.
      
      The approach makes the migration from JUnit 4 to JUnit Jupiter rather
      straightforward; however, there is one major downside. The arguments
      for a @ParameterizedTest test method can only be accessed by the test
      method itself. It is not possible to access them in an @BeforeEach
      method (see https://github.com/junit-team/junit5/issues/944).
      Consequently, we are forced to declare the parameters in each such
      method and delegate to a custom "setup" method. Although this is a bit
      cumbersome, I feel it is currently the best way to achieve fine grained
      parameterized tests within our test suite without implementing a custom
      TestTemplateInvocationContextProvider for each specific use case.
      
      Once https://github.com/junit-team/junit5/issues/878 is resolved, we
      should consider migrating to parameterized test classes.
      
      See gh-23451
      3df85c78
  2. 07 8月, 2019 1 次提交
  3. 31 7月, 2019 1 次提交
  4. 30 7月, 2019 2 次提交
    • A
      Add support for non-standard status codes · 29ef9854
      Arjen Poutsma 提交于
      Added support for status codes that do not occur in HttpStatus in
      DefaultClientResponseBuilder and made ClientResponse::statusCode
      ClientHttpResponse::getStatusCode @Nullable.
      
      Closed gh-23366
      29ef9854
    • A
      Add onRawStatus to WebClient · 6cb4b8bd
      Arjen Poutsma 提交于
      - Add onRawStatus to WebClient.ResponseSpec, allowing users to deal with
        raw status codes that are not in HttpStatus.
      - No longer throw an exception status codes not in HttpStatus.
      
      Closes gh-23367
      6cb4b8bd
  5. 28 7月, 2019 1 次提交
    • S
      Introduce common SimpleUrlHandlerMapping constructors · f53cdb8b
      Sam Brannen 提交于
      Prior to this commit, the SimpleUrlHandlerMapping classes in Spring MVC
      and Spring Webflux only had default constructors. This lead to the fact
      that users often had to explicitly invoke setUrlMap() and setOrder() on
      the newly instantiated SimpleUrlHandlerMapping.
      
      In order to simplify the programmatic setup of a SimpleUrlHandlerMapping
      in common scenarios, this commit introduces the following constructors.
      
      - SimpleUrlHandlerMapping()
      - SimpleUrlHandlerMapping(Map<String, ?> urlMap)
      - SimpleUrlHandlerMapping(Map<String, ?> urlMap, int order)
      
      Closes gh-23362
      f53cdb8b
  6. 22 7月, 2019 1 次提交
  7. 21 7月, 2019 1 次提交
  8. 18 7月, 2019 1 次提交
  9. 16 7月, 2019 1 次提交
    • A
      Interpret empty mono from status handler as normal response · a9b3d95a
      Arjen Poutsma 提交于
      Prior to this commit, returning an empty mono from an exception handler
      registered through ResponseSpec::onStatus would result in memory leaks
      (since the response was not read) and in an empty response from bodyTo*
      methods of the webclient.
      
      As of this commit, that same empty mono is now interpreted to return
      the body (and not an exception), offering a way to override the default
      status handlers and return a normal response for 4xx and 5xx status
      codes.
      a9b3d95a
  10. 13 7月, 2019 1 次提交
  11. 12 7月, 2019 2 次提交
    • A
      Add ClientResponse::createException · b4207823
      Arjen Poutsma 提交于
      This commit adds the createException() method to ClientResponse,
      returning a delayed WebClientResponseException based on the status code,
      headers, and body as well as the corresponding request.
      
      Closes gh-22825
      b4207823
    • R
      Fix http URLs · fde92793
      Rob Winch 提交于
      See gh-22839
      fde92793
  12. 11 7月, 2019 1 次提交
    • S
      Add engineSupplier property to ScriptTemplateConfigurer · c8f8dfa3
      Sebastien Deleuze 提交于
      This commit adds an engineSupplier property to ScriptTemplateConfigurer
      and ScriptTemplateView in order to be able to customize the ScriptEngine
      when sharedEngine is set to false.
      
      This can be useful with Graal.js for example.
      
      Closes gh-23258
      c8f8dfa3
  13. 10 7月, 2019 1 次提交
  14. 08 7月, 2019 1 次提交
    • S
      Add body methods with Object parameter to WebFlux · 2b4d6ce3
      Sebastien Deleuze 提交于
      The commit deprecates syncBody(Object) in favor of body(Object)
      which has the same behavior in ServerResponse, WebClient and
      WebTestClient. It also adds body(Object, Class) and
      body(Object, ParameterizedTypeReference) methods in order to support
      any reactive type that can be adapted to a Publisher via
      ReactiveAdapterRegistry. Related BodyInserters#fromProducer
      methods are provided as well.
      
      Shadowed Kotlin body<T>() extensions are deprecated in favor of
      bodyWithType<T>() ones, including dedicated Publisher<T> and
      Flow<T> variants. Coroutines extensions are adapted as well, and
      body(Object) can now be used with suspending functions.
      
      Closes gh-23212
      2b4d6ce3
  15. 05 7月, 2019 3 次提交
  16. 02 7月, 2019 2 次提交
  17. 21 6月, 2019 1 次提交
    • A
      Add Flux<Part> ServerRequest.parts() · 92981ac9
      Arjen Poutsma 提交于
      This commit introduces Flux<Part> ServerRequest.parts() that delegates
      to ServerWebExchange.getParts() and offers an alternative,
      streaming way of accessing multipart data.
      
      Closes gh-23131
      92981ac9
  18. 20 6月, 2019 1 次提交
    • S
      Leverage new Kotlin script templating support · e86b937f
      Sebastien Deleuze 提交于
      As of 1.3.40, Kotlin now provides a kotlin-scripting-jsr223-embeddable
      dependency which:
       - Fixes classloading related issues
       - Provides out of the box JSR 223 support
       - Is compatible with Spring Boot Fat Jar mechanism
      
      This commit updates Spring Framework tests and documentation accordingly.
      
      Closes gh-23165
      e86b937f
  19. 14 6月, 2019 1 次提交
    • A
      Use DataBufferUtils.write in DefaultFilePart.transferTo · 30af01fd
      Arjen Poutsma 提交于
      This commit makes sure that in DefaultMultipartMessageReader's
      DefaultFilePart, the file is not closed before all bytes are written,
      by using DataBufferUtils.write (see c1b6885191d6a50347aeaa14da994f0db88f26fe).
      
      The commit also improves on the logging of the
      DefaultMultipartMessageReader.
      
      Closes gh-23130
      30af01fd
  20. 13 6月, 2019 1 次提交
    • S
      Do not override requestContextAttribute with null in UrlBasedViewResolvers · 451cce4f
      Sam Brannen 提交于
      Prior to this commit, if a subclass of
      org.springframework.web.servlet.view.AbstractView or
      org.springframework.web.reactive.result.view.AbstractUrlBasedView
      configured a custom value for the requestContextAttribute, that value
      was overwritten with null whenever the View was dynamically
      instantiated by a UrlBasedViewResolver, and this could lead to
      confusing behavior for users of the View.
      
      This commit addresses this issue by ensuring that the
      UrlBasedViewResolvers in spring-webmvc and spring-webflux do not
      override the requestContextAttribute in a View if the
      UrlBasedViewResolver has not been explicitly configured with a custom
      requestContextAttribute value.
      
      Closes gh-23129
      451cce4f
  21. 12 6月, 2019 1 次提交
    • S
      Improve FreeMarker macro support in spring-webflux · cc4593fd
      Sam Brannen 提交于
      This commit improves the FreeMarker macro support in spring-webflux by
      automatically exposing a RequestContext under the name
      "springMacroRequestContext" for use with Spring's FreeMarker macros in
      spring.ftl.
      
      This aligns with the user experience for FreeMarkerView in spring-webmvc.
      
      Closes gh-23105
      cc4593fd
  22. 10 6月, 2019 1 次提交
  23. 09 6月, 2019 1 次提交
  24. 05 6月, 2019 1 次提交
  25. 28 5月, 2019 1 次提交
    • S
      Clean up Mockito usage · 141ef908
      Sam Brannen 提交于
      This commit migrates to the MockitoJUnitRunner where sensible, which
      will later allow for an easier migration to Mockito's extension for
      JUnit Jupiter.
      
      In addition, this commit deletes unnecessary stubbing for various mocks
      and polishes test fixture setup in various test classes.
      141ef908
  26. 24 5月, 2019 2 次提交
  27. 21 5月, 2019 2 次提交
  28. 17 5月, 2019 3 次提交
  29. 12 5月, 2019 2 次提交
  30. 09 5月, 2019 1 次提交
    • P
      Migrate to BDD Mockito · 798b51f4
      Phillip Webb 提交于
      Migrate all tests to consistently use BDD Mockito. Also add
      checksyle rule to enforce going forwards.
      798b51f4