Commit Graph

184 Commits

Author SHA1 Message Date
Stephane Nicoll
ec15607bad Merge branch '1.5.x' 2016-12-25 10:00:48 +01:00
Stephane Nicoll
37519ecfef Merge branch '1.4.x' into 1.5.x 2016-12-25 10:00:33 +01:00
Stephane Nicoll
062104f1d6 Fix TestRestTemplate#patchFor methods visibility
Closes gh-7742
2016-12-25 10:00:20 +01:00
Spring Buildmaster
9057f9ae1f Next development version 2016-12-23 00:15:23 +00:00
Phillip Webb
6e02fe59f7 Merge branch '1.5.x' 2016-12-21 22:32:43 -08:00
Phillip Webb
765fd1dca0 Merge branch '1.4.x' into 1.5.x 2016-12-21 20:15:54 -08:00
Phillip Webb
138b96cf5f Use unique testRestTemplate bean name
Update `SpringBootTestContextCustomizer` to use the full qualified
TestRestTemplate as the registered bean name. Prior to this commit it
was possible that the customizer would replace the relatively common
bean name `testRestTemplate`.

Fixes gh-7711
2016-12-21 11:42:56 -08:00
Phillip Webb
571544d1b3 Merge branch '1.5.x' 2016-12-19 18:46:03 -08:00
Phillip Webb
73a45797c0 Merge branch '1.4.x' into 1.5.x 2016-12-19 18:45:35 -08:00
Phillip Webb
7824171413 Allow @SpyBean to work with @Primary beans
Update `MockitoPostProcessor` so that `@SpyBean` will automatically
pick the `@Primary` bean when multiple candidates exist.

Fixes gh-7621
2016-12-19 18:14:51 -08:00
Phillip Webb
87547f208a Add test for @SpyBean for generic bean definition
Add an integration test to check that @SpyBean can be used with on a
bean definition that returns a generic type.

Closes gh-7625
2016-12-19 15:58:25 -08:00
Phillip Webb
1f417997f3 Merge branch '1.5.x' 2016-12-19 13:21:18 -08:00
Phillip Webb
4b9cba351b Merge branch '1.4.x' into 1.5.x 2016-12-19 12:36:57 -08:00
Phillip Webb
bd74c3d327 Polish formatting 2016-12-19 12:25:09 -08:00
Stephane Nicoll
b000e182a2 Merge branch '1.5.x' 2016-12-19 11:32:33 +01:00
Stephane Nicoll
28e86272e8 Merge branch '1.4.x' into 1.5.x 2016-12-19 11:30:56 +01:00
Stephane Nicoll
863f97dc11 Polish since version
Closes gh-7412
2016-12-19 11:30:38 +01:00
Andy Wilkinson
367de7bf71 Add support for new PATCH methods to TestRestTemplate
Closes gh-7412
2016-12-19 11:27:10 +01:00
Phillip Webb
263d444d4e Merge branch '1.5.x' 2016-12-05 11:20:24 -08:00
Phillip Webb
f6b0652369 Merge branch '1.4.x' into 1.5.x 2016-12-05 11:17:13 -08:00
Phillip Webb
e430583eaf Polish 2016-12-05 11:08:38 -08:00
Stephane Nicoll
816c236e5b Merge branch '1.5.x' 2016-12-01 16:28:29 +01:00
Stephane Nicoll
ee72e788ed Rename spring-boot-junit-runners to spring-boot-test-support
Closes gh-7421
2016-12-01 16:25:47 +01:00
Andy Wilkinson
304fff1bee Merge branch '1.5.x' 2016-12-01 09:38:49 +00:00
Andy Wilkinson
3ac22e7cdf Merge branch '1.4.x' into 1.5.x 2016-12-01 09:38:41 +00:00
Andy Wilkinson
d9b8fc960c Correct the scope of the spock-core dependency in spring-boot-test
See gh-7524
2016-12-01 09:38:07 +00:00
Andy Wilkinson
881eaab601 Merge branch '1.5.x' 2016-11-30 21:00:48 +00:00
Andy Wilkinson
1d476b375f Merge branch '1.4.x' into 1.5.x 2016-11-30 21:00:36 +00:00
Andy Wilkinson
45d672f5b3 Ignore Spock annotations when creating test context cache key
Closes gh-7524
2016-11-30 20:59:09 +00:00
Andy Wilkinson
e5e22af73e Merge branch '1.5.x' 2016-11-25 10:41:49 +00:00
Andy Wilkinson
3dcb2d5316 Merge branch '1.4.x' into 1.5.x 2016-11-25 10:41:41 +00:00
Andy Wilkinson
46e8cf4a43 Test that a broken factory bean does not break resetting of mocks
Previously, ResetMocksTestExecutionListener used getBean(name) to
retrieve each instantiated singleton. When the instantiated singleton
was a factory bean, this would cause getObject on the factory bean to
be called. If the factory bean was unable to produce its object, for
example due to test slicing excluding something, an exception would
be thrown.

The previous commit updated ResetMocksTestsExecutionListener to
use getSingleton(name) rather than getBean(name).  This will retrieve
the factory bean itself rather than causing the factory bean to
attempt to create an object. This commit updates the tests to verify
the new behaviour.

Closes gh-7270
2016-11-25 10:40:02 +00:00
Aleksander Bartnikiewicz
eb927f1b29 Prevent a broken factory bean from breaking the resetting of mocks
Closes gh-7271
2016-11-25 10:39:30 +00:00
Phillip Webb
e0dfff2b23 Merge branch '1.5.x' 2016-11-22 14:54:17 -08:00
Phillip Webb
88c84ce234 Merge branch '1.4.x' into 1.5.x 2016-11-22 14:53:30 -08:00
Phillip Webb
a3b79be6b3 Support @MockBean on FactoryBeans
Update @MockBean support so that FactoryBean classes can be mocked.

Fixes gh-7439
2016-11-22 13:49:28 -08:00
Phillip Webb
1452d3cd51 Ensure withBasicAuth keeps error handler
Fix `TestRestTemplate` so that any custom `ErrorHandler` isn't lost
when calling `withBasicAuth`.

Fixes gh-7441
2016-11-22 10:58:30 -08:00
Phillip Webb
20d7dd5747 Merge branch '1.5.x' 2016-11-18 17:30:03 -08:00
Phillip Webb
1657120286 Move ModifiedClassPathRunner to its own module
Migrate `ModifiedClassPathRunner` from `spring-boot` test source to
its own module.

Fixes gh-7420
2016-11-18 17:27:54 -08:00
Andy Wilkinson
9ec38dc8c1 Merge branch '1.5.x' 2016-11-18 16:57:02 +00:00
Andy Wilkinson
f35fa87366 Fix problems in SpringBootMockUtil reported by Checkstyle 2016-11-18 16:56:36 +00:00
Andy Wilkinson
9273b1789b Merge branch '1.5.x' 2016-11-18 16:41:22 +00:00
Andy Wilkinson
1cd781b242 Make spring-boot-test compatible with Mockito 2.1 and 2.2
We use some internal Mockito classes and some  breaking API changes
have been made to them in Mockito 2. This commit introduces a utility
class, SpringBootMockUtil, to shield our code from these differences.
Mockito 1 is called directly and Mockito 2 is called via reflection.

To allow these changes to be tested, FilteredClassPathRunner has been
enhanced to also support overriding a dependency on the class path.
As a result it has been renamed to ModifiedClassPathRunner. The new
ClassPathOverrides annotation can be used to provide the Maven
coordinates of one or more dependencies that should be resolved and
added to the class path. Such additions are added to the start of
the class path so that they override any existing dependency that
contains the same classes.

Closes gh-6520
2016-11-18 16:39:44 +00:00
Andy Wilkinson
6361a6728a Add support for new PATCH methods to TestRestTemplate
Closes gh-7412
2016-11-17 19:51:16 +00:00
Phillip Webb
cb7c0b5031 Merge branch '1.5.x' 2016-11-16 16:06:53 -08:00
Phillip Webb
7daf69a393 Upgrade to HTMLUnit 2.23 (+selenium module 2.23.2)
Fixes gh-7232
2016-11-16 15:30:34 -08:00
Spring Buildmaster
e712a9ba8c Next Development Version 2016-11-08 16:55:37 +00:00
Stephane Nicoll
e509278580 Merge branch '1.5.x' 2016-10-24 11:39:38 +02:00
Stephane Nicoll
eddb10e4c9 Merge branch '1.4.x' into 1.5.x 2016-10-24 11:39:26 +02:00
Stephane Nicoll
4603d8259a Make MockitoTestExecutionListener public
Closes gh-7016
2016-10-24 11:37:20 +02:00