1. 09 5月, 2019 2 次提交
    • 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
    • P
      Remove '.*' imports from tests · 816bbee8
      Phillip Webb 提交于
      Organize test imports to expand all '.*' static imports into
      fully qualified imports.
      
      This update will allow us to use additional checkstyle rules in
      the future, and will also help if we migrate fully to AssertJ.
      816bbee8
  2. 06 5月, 2019 1 次提交
  3. 23 3月, 2019 1 次提交
  4. 22 3月, 2019 1 次提交
  5. 14 11月, 2018 1 次提交
  6. 30 5月, 2018 1 次提交
  7. 23 5月, 2018 1 次提交
  8. 20 3月, 2018 1 次提交
  9. 18 10月, 2017 1 次提交
  10. 11 10月, 2017 1 次提交
    • B
      ResourceWebHandler signals error for missing resources · 3febec3d
      Brian Clozel 提交于
      Prior to this commit, the `ResourceWebHandler` would itself handle the
      response with an HTTP 404 in many cases, including a missing static
      resource.
      
      This does not give a chance to `WebExceptionHandler` instances to handle
      that error and, for example, display an error page.
      
      See spring-projects/spring-boot#8625
      
      Issue: SPR-16023
      3febec3d
  11. 30 9月, 2017 1 次提交
  12. 28 7月, 2017 1 次提交
  13. 11 7月, 2017 1 次提交
  14. 02 7月, 2017 1 次提交
  15. 30 6月, 2017 1 次提交
  16. 10 6月, 2017 1 次提交
    • R
      ResourceWebHandler uses MediaTypeFactory directly · cb604738
      Rossen Stoyanchev 提交于
      There is no need for ResourceWebHandler to go through the
      PathExtensionContentTypeResolver when MediaTypeFactory makes it easy to
      perform such lookups for a given Resource.
      
      This does not support any extensions explicitly registered through a
      WebFluxConfigurer but it would be easy enough to pass those into
      ResourceWebHandler as a simple Map<String, MediaType>, should the need
      arise.
      
      Issue: SPR-15639
      cb604738
  17. 30 5月, 2017 1 次提交
  18. 21 3月, 2017 1 次提交
  19. 20 3月, 2017 1 次提交
    • R
      ResourceHttpMessageWriter refactoring · 76fe5f6f
      Rossen Stoyanchev 提交于
      Fold ResourceRegionHttpMessageWriter into ResourceHttpMessageWriter.
      The latter was a private helper (not meant to be exposed) and the two
      have much in common now sharing a number of private helper methods.
      
      The combined class does not extend AbstractServerHttpMessageConverter
      from which it was not using anything.
      
      Internally the combined class now delegates directly to ResourceEncoder
      or ResourceRegionEncoder as needed. The former is no longer wrapped
      with EncoderHttpMessageWriter which is not required since "resource"
      MediaType determination is a bit different.
      
      The consolidation makes it easy to see the entire algorithm in one
      place especially for server side rendering (and HTTP ranges). It
      also allows for consistent determination of the "resource" MediaType
      via MediaTypeFactory for all use cases.
      76fe5f6f
  20. 18 3月, 2017 2 次提交
    • R
      Fix content type issue in ResourceRegionHttpMessageWriter · c735ffb3
      Rossen Stoyanchev 提交于
      ResourceRegionHttpMessageWriter no longer extends from
      EncoderHttpMessageWriter freeing it to pass the correct content type
      into the encoder.
      
      Considering that the main benefit of EncoderHttpMessageWriter is to
      deal with content type fallback cases, there is nothing to be missed.
      
      Furthermore ResourceRegionHttpMessageWriter is a package private class
      that is used internally within ResourceHttpMessageWriter and never
      exposed externally as a an actual HttpMessageWriter.
      
      Issue: SPR-15358
      c735ffb3
    • R
      Consistent use of Mediatype in EncoderHttpMessageWriter · 2979b37a
      Rossen Stoyanchev 提交于
      EncoderHttpMessageWriter now consistently uses the same MediaType to
      set on the response and to pass to the encoder.
      
      Issue: SPR-15357
      2979b37a
  21. 16 3月, 2017 1 次提交
  22. 21 2月, 2017 1 次提交
  23. 08 2月, 2017 1 次提交
    • R
      Improve writing in mock reactive request and response · f2967467
      Rossen Stoyanchev 提交于
      Before this change the write Publisher was saved and Mono.empty()
      returned from the write metohd which did not properly implement
      the write contract since no writing ("consuming") was done.
      
      This can be a problem in some cases. For example the request may appear
      to succeed even if the publisher produces an error later when
      subscribed to later after request handling completes.
      
      This commit introduces a writeHandler function in the mock request and
      response. By default it "writes" by consuming the content immediately,
      which allows it to return a Mono<Void> that properly reflects when
      writing is done, and it also caches the data so it may be replayed
      later for test assertions.
      
      For streaming scenario a custom writeHandler may be registered which
      allows the custom handling to determine how long to stream before
      cancelling so request handling may complete.
      
      Issue: SPR-14590
      f2967467
  24. 02 2月, 2017 1 次提交
  25. 14 1月, 2017 1 次提交
    • R
      Refactor reactive mock request and response support · ba3cc535
      Rossen Stoyanchev 提交于
      MockServerHttpRequest and MockServerHttpResponse now extend the same
      abstract base classes that server-specific implementations do and
      therefore approximate their behavior more closely.
      
      As an immediate consequence MockServerHttpRequest is read-only after
      it is created. Instead it now exposes static builder methods similar
      to those found in RequestEntity. This enforces more strictness as well
      as recycling of requests in tests and provides nicer builder methods.
      
      To simplify tests DefaultServerWebExchange now offers a constructor
      with just a request and response, and automatically creating a
      DefaultWebSessionManager.
      
      The spring-test module now also contains client-side reactive mock
      request and response implementations. The mock client request extends
      the same AbstractClientHttpRequest as client-specific implementations
      do. There is no abstract base class for client responses.
      
      Issue: SPR-14590
      ba3cc535
  26. 03 11月, 2016 1 次提交
  27. 02 11月, 2016 1 次提交
  28. 25 10月, 2016 1 次提交
    • B
      Refactor tests with ScriptedSubscriber · 99a32108
      Brian Clozel 提交于
      Reactor recently added the `ScriptedSubscriber` in its new
      `reactor-addons` module. This `Subscriber` revissits the previous
      `TestSubscriber` with many improvements, including:
      
      * scripting each expectation
      * builder API that guides you until the final verification step
      * virtual time support
      
      This commit refactor all existing tests to use this new
      infrastructure and removed the `TestSubscriber` implementation.
      
      Issue: SPR-14800
      99a32108
  29. 21 9月, 2016 2 次提交
  30. 20 9月, 2016 1 次提交
    • B
      Add range requests support in ResourceWebHandler · 3596e720
      Brian Clozel 提交于
      This commit handles range requests in `ResourceWebHandler`, using the
      `ResourceHttpMessageWriter` configured within the handler.
      
      This `WebHandler` will add a `HTTP_RANGE_REQUEST_HINT` writer hint
      containing all the HTTP Range information of the request.
      
      Issue: SPR-14664
      3596e720
  31. 15 9月, 2016 1 次提交
  32. 14 9月, 2016 2 次提交
  33. 06 9月, 2016 1 次提交
    • R
      Resource handling support for Spring Web Reactive · 1ae64bfb
      Rossen Stoyanchev 提交于
      A straight-forward port of the resource handling support in
      spring-webmvc to spring-web-reactive. Primarily adapting contracts and
      implementations to use the reactive request and response and the
      reactive ResourceHttpMessageWriter.
      
      Issue: SPR-14521
      1ae64bfb