Commit Graph

996 Commits

Author SHA1 Message Date
Sebastien Deleuze
5bb8c47b14 Rename fromObject to fromValue in BodyInserters
Closes gh-23587
2019-09-09 00:08:55 +02:00
Sam Brannen
5d5f9aceca Avoid accidental usage of JUnit 4 assumptions
This commit also avoids starting a server if an assumption fails.
2019-09-06 16:03:36 +02:00
Sam Brannen
ef50777535 Polishing 2019-09-05 13:45:38 +02:00
Sam Brannen
d9e3b8b9a5 Introduce default constructor in TomcatHttpServer 2019-09-05 13:45:38 +02:00
Sebastien Deleuze
40a55b412d Rename BodyBuilder#bodyAndAwait to bodyValueAndAwait 2019-09-05 13:34:11 +02:00
Phillip Webb
deba2ed1b3 Add blank line between java and javax imports
See gh-23539
2019-09-04 22:05:46 -07:00
Sam Brannen
803643559a Merge branch '5.1.x' 2019-09-04 16:24:44 +02:00
Sam Brannen
d036b5a283 Do not treat void and Void as simple types in BeanUtils
Prior to this commit, the isSimpleProperty() and isSimpleValueType()
methods in BeanUtils treated void and Void as simple types; however,
doing so does not make sense in this context, since void implies the
lack of a property or value.

This commit addresses this by explicitly excluding void and Void in the
logic in isSimpleValueType().

This commit also simplifies the implementation of
ViewResolutionResultHandler.supports(HandlerResult) to take advantage
of this change.

Closes gh-23573
2019-09-04 15:48:40 +02:00
Juergen Hoeller
48934cba1b Polishing 2019-09-04 12:19:08 +02:00
Sebastien Deleuze
9b33b0ad58 Rename CoroutinesUtils#invokeHandlerMethod to invokeSuspendingFunction 2019-09-03 23:41:53 +02:00
Sam Brannen
1c5b949df0 Fix ViewResolutionResultHandlerTests
See gh-23572
2019-09-03 16:56:50 +02:00
Arjen Poutsma
37398c669c Add toBodilessEntity to ClientResponse and WebClient.ResponseSpec
See gh-23498
2019-09-03 15:44:02 +02:00
Arjen Poutsma
f5640cbfe0 Add ClientResponse::releaseBody
See gh-23498
2019-09-03 15:44:02 +02:00
Sam Brannen
c78960a1ba Merge branch '5.1.x' 2019-09-03 14:21:39 +02:00
Sam Brannen
f37ec90f2f Consider Void.class a primitive wrapper in ClassUtils
Prior to this commit, ClassUtils.isPrimitiveOrWrapper() and
ClassUtils.isPrimitiveWrapper() did not return true for Void.class.
However, ClassUtils.isPrimitiveOrWrapper() did return true for
void.class. This lacking symmetry is inconsistent and can lead to bugs
in reflective code.

See: https://github.com/spring-projects/spring-data-r2dbc/issues/159

This commit addresses this by adding an entry for Void.class -> void.class
in the internal primitiveWrapperTypeMap in ClassUtils.

Closes gh-23572
2019-09-03 14:02:24 +02:00
Sam Brannen
bf758eab33 Fix assertion in HandlerMethodMappingTests.unregisterMapping() 2019-09-03 12:13:56 +02:00
Sebastien Deleuze
a2e740c896 Polishing 2019-09-02 16:37:42 +02:00
Sebastien Deleuze
ca02cc1194 Migrate to AssertJ in Kotlin tests
Closes gh-23475
2019-09-02 15:59:26 +02:00
Arjen Poutsma
3fcf4233a2 Merge branch '5.1.x' 2019-09-02 15:19:30 +02:00
Arjen Poutsma
f748b1e68d Fix timing bug in DataBufferUtils::readAsynchronousFileChannel
This commit makes sure that reading is enabled after the current
signal has been processed, not while is is being processed. The bug
was only apparent while using the JettyClientHttpConnector, which
requests new elements continuously, even after the end of the
stream has been signalled.
2019-09-02 15:13:22 +02:00
康智冬
a6f4862f13 Fix typos related to indefinite articles
Closes gh-23555
2019-09-01 15:45:49 +02:00
Arjen Poutsma
67d48ed821 Merge branch '5.1.x' 2019-08-29 17:18:22 +02:00
Arjen Poutsma
d709a69ff1 Remove buffering of encoded parts in MultipartHttpMessageWriter
Closes gh-23518
2019-08-29 16:34:36 +02:00
Sam Brannen
c004ef888c Configure index in @ParameterizedTest display names
This commit prepends "[{index}] " to all custom display names
configured via @ParameterizedTest.

This provides better diagnostics between the "technical names" reported
on the CI server vs. the "display names" reported within a developer's
IDE.

See gh-23451
2019-08-28 17:06:23 +02:00
Sebastien Deleuze
52976246ac Remove bodyWithType extension from WebFlux
Since there is no more clash with the new bodyValue
method name.

Closes gh-23523
2019-08-28 13:30:16 +02:00
Sam Brannen
216ffcfe62 Fix copyright dates 2019-08-27 18:28:31 +02:00
Сергей Цыпанов
6ef75d76cd Simplify String concatenation
Closes gh-23470
2019-08-27 18:22:44 +02:00
Sam Brannen
f8f3067419 Polishing 2019-08-27 12:27:18 +02:00
lijuny
a0d50a546b Polish tests in spring-aop
This commit polishes tests in spring-aop by using
OrderComparator.sort() and lambda expressions instead of anonymous
classes where feasible.

Closes gh-23458
2019-08-27 12:01:30 +02:00
Sam Brannen
ad6231ad29 Add missing @Override annotations 2019-08-23 13:50:58 +02:00
Rossen Stoyanchev
1d2ebdeb8c More optimal RequestMethod condition lookup
See gh-22644
2019-08-22 13:39:20 +03:00
Rossen Stoyanchev
aa220a9a02 Polish 2019-08-21 11:20:37 +03:00
Rob Winch
ca3a0b19d6 DefaultWebClientBuilder defaults using classpath
Previously DefaultWebClientBuilder always defaulted the ClientHttpConnector
with ReactorClientHttpConnector. This worked fine if reactor was used.
However, it would break if the user was trying to leverage Jetty.

This commit defaults to use Reactory Netty HttpClient if it is present. If
it is not present it then Jetty's HttpClient  is used if present.

Closes gh-23491
2019-08-21 11:04:14 +03:00
Rossen Stoyanchev
ff6ccd0d04 Adapt tests changed in 5.1.x to master 2019-08-21 10:24:46 +03:00
Rossen Stoyanchev
364c7c459d Merge branch '5.1.x' 2019-08-21 10:21:32 +03:00
Rossen Stoyanchev
6d8bf3466c Suppress decoding error for resource path
Closes gh-23463
2019-08-21 10:02:15 +03:00
Sam Brannen
91560d51ac Polish AbstractWebSocketIntegrationTests 2019-08-20 12:43:30 +02:00
Rossen Stoyanchev
26dc93d0f6 Polish body methods
WebClient, WebTestClient, and ServerResponse
2019-08-20 10:27:06 +03:00
Rossen Stoyanchev
b75674f5e9 Polish method order 2019-08-20 10:27:05 +03:00
Rossen Stoyanchev
008687d5ae Rename body(Object) to bodyValue
The recently added body(Object) variant can be confused easily with
body(Publisher, Class) forgetting to provide the element type and
only running into the IllegalArgumentException at runtime.

See gh-23212
2019-08-20 10:27:05 +03:00
Rossen Stoyanchev
5cfe491602 Polish AbstractWebSocketIntegrationTests 2019-08-20 03:03:58 +03:00
Sebastien Deleuze
4d10249b70 Update to Coroutine 1.3.0-RC2
This updates brings full interoperability between Reactor and
Coroutines contexts.

Closes gh-22986
2019-08-19 10:03:01 +02:00
Sam Brannen
31cde12540 Fix off-by-one error in AbstractWebSocketIntegrationTests.arguments()
Prior to this commit, the "reactive matrix" contained a duplicate
argument set per parameterized client.
2019-08-17 14:47:25 +02:00
Sam Brannen
979508a7f3 Remove JUnit 4 dependency from all modules except spring-test
This commit removes the JUnit 4 dependency from all modules except
spring-test which provides explicit JUnit 4 support.

This commit also includes the following.

- migration from JUnit 4 assertions to JUnit Jupiter assertions in all
  Kotlin tests
- migration from JUnit 4 assumptions in Spring's TestGroup support to
  JUnit Jupiter assumptions, based on org.opentest4j.TestAbortedException
- introduction of a new TestGroups utility class than can be used from
  existing JUnit 4 tests in the spring-test module in order to perform
  assumptions using JUnit 4's Assume class

See gh-23451
2019-08-17 11:37:21 +02:00
Sam Brannen
3f3e41923f Migrate rest of test suite from JUnit 4 to JUnit Jupiter
This commit migrates the rest of Spring's test suite to JUnit Jupiter,
except spring-test which will be migrated in a separate commit.

See gh-23451
2019-08-17 11:36:58 +02:00
Sam Brannen
3df85c783f Migrate parameterized tests in spring-core
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
2019-08-17 11:36:47 +02:00
Sam Brannen
e7e5cce735 Polish contribution
See gh-23457
2019-08-13 10:36:46 +02:00
Sauhard Sharma
91c0fbaadb Use valid example in Javadoc for @EnableWebFlux
This commit modifies the class-level Javadoc for the @EnableWebFlux
annotation to reference an actual method in WebFluxConfigurer.

Closes gh-23457
2019-08-13 10:27:29 +02:00
Sam Brannen
d32cb7dac3 Avoid use of GenericTypeResolver.resolveParameterType() in tests
This commit avoids the use of the deprecated
GenericTypeResolver.resolveParameterType() method in tests in order to
avoid warnings in the Gradle build.
2019-08-07 14:23:15 +02:00
Juergen Hoeller
dea9ad6cb2 Merge branch '5.1.x' 2019-07-31 23:53:32 +02:00