Commit Graph

1438 Commits

Author SHA1 Message Date
Juergen Hoeller e2d01bb783 Merge branch '5.1.x' 2019-06-22 17:11:31 +02:00
Juergen Hoeller 29dcd19971 Upgrade to AspectJ 1.9.4, RxJava 2.2.10, Jetty 9.4.19, Undertow 2.0.22
Includes Hibernate Validator 6.0.17 and renames "withoutJclOverSlf4j".
2019-06-22 16:49:40 +02:00
Arjen Poutsma 92981ac9de Add Flux<Part> ServerRequest.parts()
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
2019-06-21 10:59:13 +02:00
Sam Brannen ef6471fcbf Polish contribution
See gh-23141
2019-06-18 18:59:18 +03:00
RustyTheClone 72adc3d37e Support target type in MockMvcResultMatchers.jsonPath()
This commit introduces an overloaded jsonPath() method to specify a
target type to coerce into for MockMvcResultMatchers.

 - jsonPath(String, Matcher<T>, Class<T>)

Closes gh-23141
2019-06-18 18:57:27 +03:00
Sam Brannen 89ebdc766c Polishing 2019-06-18 18:53:47 +03:00
Sam Brannen 8ceac9c015 Document supported @Transactional attributes in the TCF
This commit documents which attributes in @Transactional are supported
for test-managed transactions in the Spring TestContext Framework (TCF).

Closes gh-23149
2019-06-18 14:34:28 +03:00
Juergen Hoeller 0a77477d32 Merge branch '5.1.x' 2019-06-12 18:16:30 +02:00
Juergen Hoeller fc46abf0b7 Polishing 2019-06-12 18:04:06 +02:00
Juergen Hoeller 7e02358166 Merge branch '5.1.x' 2019-06-12 00:05:01 +02:00
Juergen Hoeller 22aba8bf60 Upgrade to Apache HttpClient 4.5.9 2019-06-11 23:49:57 +02:00
Juergen Hoeller a89bfffd8c Merge branch '5.1.x' 2019-06-11 23:16:03 +02:00
Juergen Hoeller 7dc92aa05d Polishing 2019-06-11 20:57:27 +02:00
Sam Brannen dfbf742547 Polishing 2019-06-11 13:54:11 +03:00
Sam Brannen 59d070e12a Test JUnit Jupiter 5.5 @Timeout support with Spring transactions
See gh-23076
2019-06-10 17:57:56 +03:00
Sam Brannen e903bf440b Polishing 2019-06-06 17:57:14 +03:00
Sam Brannen 61bf45c86f Merge branch '5.1.x' 2019-06-06 17:40:51 +03:00
Ilya Lukyanovich 2ed81be831 Fix MockHttpServletRequest.setCookies to produce single cookie header
Prior to this commit, MockHttpServletRequest.setCookies() produced one
Cookie header per supplied cookie, resulting in multiple Cookie headers
which violates the specification.

This commit fixes this by ensuring that all cookie name-value pairs are
stored under a single Cookie header, separated by a semicolon.

Closes gh-23074
2019-06-06 17:13:21 +03:00
Sebastien Deleuze 098ac0bbb8 Annotate Object#equals parameter with @Nullable
Closes gh-23093
2019-06-06 14:18:30 +02:00
Сергей Цыпанов aaeabc3c85 Simplify iteration over maps
Closes gh-23053
2019-05-29 18:00:34 +02:00
Sam Brannen 4b9f5a35a6 Polish contribution 2019-05-27 11:22:11 +02:00
Сергей Цыпанов 6964ed33bf Allocate objects only when it's necessary
Closes gh-23036
2019-05-27 11:14:25 +02:00
Sam Brannen 4f4427f550 Migrate TestNG assertions to AssertJ
Migrate all existing TestNG based assertions to AssertJ and add
Checkstyle rules to ensure they don't return.

See gh-23022
2019-05-26 18:29:39 +02:00
Sam Brannen 50cc23ca55 Use the JUnit Platform Test Kit in spring-test 2019-05-26 14:28:09 +02:00
Phillip Webb 6b9160b3ae Restore transaction specific assertions
Revert 82d0e49d and instead create a `TransactionAssert` class.

Closes gh-23022
2019-05-24 11:09:44 -07:00
Sam Brannen 5a1217cafe Migrate JUnit Jupiter assertions to AssertJ
Migrate all existing JUnit Jupiter based assertions to AssertJ and add
Checkstyle rules to ensure they don't return.

See gh-23022
2019-05-24 18:50:01 +02:00
Phillip Webb 82d0e49de9 Inline methods from TransactionTestUtils
Delete `TransactionTestUtils` and inline AssertJ assertions
instead.

Closes gh-23022
2019-05-23 16:38:39 -07:00
Phillip Webb 9d74da006c Migrate JUnit 4 assertions to AssertJ
Migrate all existing JUnit 4 `assert...` based assertions to AssertJ
and add a checkstyle rule to ensure they don't return.

See gh-23022
2019-05-23 15:52:49 -07:00
Phillip Webb 95a9d46a87 Migrate Hamcrest assertions to AssertJ
Migrate all existing `assertThat(..., Matcher)` assertions to AssertJ
and add checkstyle rules to ensure they don't return.

See gh-23022
2019-05-23 15:49:59 -07:00
Phillip Webb 02850f357f Migrate exception checking tests to use AssertJ
Migrate tests that use `@Test(expectedException=...)` or
`try...fail...catch` to use AssertJ's `assertThatException`
instead.
2019-05-20 10:47:53 -07:00
Juergen Hoeller 9755b59197 Merge branch '5.1.x' 2019-05-13 18:05:07 +02:00
Juergen Hoeller 5910d2d4dc Add missing Nullable annotation to assertNotNull
See gh-22932
2019-05-13 18:03:01 +02:00
stsypanov 9ca8681f79 Iteration over a map using EntrySet 2019-05-13 15:38:13 +02:00
Sam Brannen 73dbd06361 Enforces static imports for JUnit 4 assertions and assumptions
This commit configures Checkstyle to enforces static imports for JUnit 4
assertions and assumptions.

See gh-22932
2019-05-12 15:13:07 +02:00
Sam Brannen da1b004254 Merge branch '5.1.x' 2019-05-11 18:21:44 +02:00
Sam Brannen e1b0bf22bf Polish Javadoc for AssertionErrors
See gh-22932
2019-05-11 18:21:06 +02:00
Sam Brannen 33fcde4c3e Merge branch '5.1.x' 2019-05-11 18:04:48 +02:00
Sam Brannen 233b225b4f Remove JUnit dependency from HeaderResultMatchers
Prior to this commit, HeaderResultMatchers had a direct dependency on
org.junit.Assert which forces JUnit 4 to be present on the classpath.

This commit fixes this by introducing assertNotNull() in
org.springframework.test.util.AssertionErrors and delegating to that
instead.

Fixes gh-22932
2019-05-11 18:03:42 +02:00
Sam Brannen 0cff7eb32c Fix Javadoc links 2019-05-10 17:40:03 +02:00
Phillip Webb 798b51f4a3 Migrate to BDD Mockito
Migrate all tests to consistently use BDD Mockito. Also add
checksyle rule to enforce going forwards.
2019-05-08 13:46:13 -07:00
Phillip Webb 816bbee8de Remove '.*' imports from tests
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.
2019-05-08 09:55:09 -07:00
Juergen Hoeller d3b713d5f0 Upgrade to Protobuf 3.7.1 and HtmlUnit 2.35 2019-05-08 17:52:56 +02:00
Sam Brannen 6a05b97df3 Log identity hash for ApplicationContext for context cache hits/misses
DefaultCacheAwareContextLoaderDelegate now logs the identity hash code
for an application context instance that was stored in or retrieved from
the context cache in the Spring TestContext Framework.

Closes gh-22925
2019-05-08 16:39:23 +02:00
Phil Webb d7320de871 Migrate away from ExpectedException (#22922)
* Add limited checkstyles to test code

Add a limited set of checkstyle rules to the test codebase to improve
code consistency.

* Fix checksyle violations in test code

* Organize imports to fix checkstyle for test code

* Migrate to assertThatExceptionOfType

Migrate aware from ExpectedException rules to AssertJ exception
assertions. Also include a checkstyle rules to ensure that the
the ExpectedException is not accidentally used in the future.

See gh-22894
2019-05-08 16:25:52 +02:00
Sam Brannen 77eef47483 Support automatic constructor injection in JUnit Jupiter
Prior to this commit, dependency injection of all arguments in a test
class constructor invoked by JUnit Jupiter was only possible if the
constructor was explicitly annotated with @Autowired.

This commit introduces support for a configurable "test constructor
autowire" mode which defaults to false in order to remain backwards
compatible.

Specifically, this mode can be configured globally for an entire test
suite via a new "spring.test.constructor.autowire" JVM system property
that can alternatively be configured via the SpringProperties
mechanism. In addition, the global "test constructor autowire" mode can
be overridden locally on a per-class basis via the new @TestConstructor
annotation.

Closes gh-22286
2019-05-08 14:51:43 +02:00
Sam Brannen d4379630e2 Use assertThat from Hamcrest instead of JUnit 4
org.junit.Assert.assertThat() is deprecated as of JUnit 4.13.

See gh-22894
2019-05-05 17:31:31 +02:00
Sam Brannen 772ef40920 Upgrade to JUnit 4.13-beta-3
See gh-22894
2019-05-05 16:56:48 +02:00
Juergen Hoeller ec8689d1fc Merge branch '5.1.x' 2019-05-03 14:23:59 +02:00
Juergen Hoeller 4e10735e8f MockHttpServletRequest restores default locale for empty accept header
Closes gh-22877
2019-05-03 14:08:12 +02:00
Juergen Hoeller 0be610b0ee Support for reactive transactions in TransactionInterceptor
Introduces TransactionManager marker interface for PlatformTransactionManager as well as ReactiveTransactionManager, allowing for a common configuration type in TransactionAspectSupport and TransactionManagementConfigurer.

Closes gh-22590
2019-05-02 16:23:48 +02:00