Commit Graph

165 Commits (530c3cd3be749effbb22fc33d2f6c62c4006c920)

Author SHA1 Message Date
Phillip Webb 8ccd4db513 Merge branch '1.4.x' into 1.5.x 8 years ago
Phillip Webb 556ce14f2d Fix TestRestTemplate.withBasicAuth interceptors
Update `TestRestTemplate` to handle `BasicAuthorizationInterceptor`s
correctly. Prior to this commit the `BasicAuthorizationInterceptor`
was added directly to the `ClientHttpRequestFactory` rather than
to the `RestTemplate`. This meant that it could not easily be removed
when `TestRestTemplate.withBasicAuth` was invoked.

The `TestRestTemplate` now sets the interceptor on `RestTemplate`
directly and relies on the logic in `InterceptingHttpAccessor` to
add it to the `ClientHttpRequestFactory`.

Fixes gh-7812
8 years ago
Phillip Webb 8b69856fc9 Polish 8 years ago
Stephane Nicoll 25bd0e0455 Do not reset server.port if a custom inline property is set
This commit allows to define `server.port` in a non-embedded web
environment. Previously, `server.port` would have been set to `-1`
regardless.

Closes gh-7353
8 years ago
Phillip Webb 884c9ef11e Remove accidentally committed file 8 years ago
Phillip Webb e0541d0f74 Polish 8 years ago
Stephane Nicoll 37519ecfef Merge branch '1.4.x' into 1.5.x 8 years ago
Stephane Nicoll 062104f1d6 Fix TestRestTemplate#patchFor methods visibility
Closes gh-7742
8 years ago
Spring Buildmaster 9057f9ae1f Next development version 8 years ago
Phillip Webb 765fd1dca0 Merge branch '1.4.x' into 1.5.x 8 years ago
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
8 years ago
Phillip Webb 73a45797c0 Merge branch '1.4.x' into 1.5.x 8 years ago
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
8 years ago
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
8 years ago
Phillip Webb 4b9cba351b Merge branch '1.4.x' into 1.5.x 8 years ago
Phillip Webb bd74c3d327 Polish formatting 8 years ago
Stephane Nicoll 28e86272e8 Merge branch '1.4.x' into 1.5.x 8 years ago
Stephane Nicoll 863f97dc11 Polish since version
Closes gh-7412
8 years ago
Andy Wilkinson 367de7bf71 Add support for new PATCH methods to TestRestTemplate
Closes gh-7412
8 years ago
Phillip Webb f6b0652369 Merge branch '1.4.x' into 1.5.x 8 years ago
Phillip Webb e430583eaf Polish 8 years ago
Stephane Nicoll ee72e788ed Rename `spring-boot-junit-runners` to `spring-boot-test-support`
Closes gh-7421
8 years ago
Andy Wilkinson 3ac22e7cdf Merge branch '1.4.x' into 1.5.x 8 years ago
Andy Wilkinson d9b8fc960c Correct the scope of the spock-core dependency in spring-boot-test
See gh-7524
8 years ago
Andy Wilkinson 1d476b375f Merge branch '1.4.x' into 1.5.x 8 years ago
Andy Wilkinson 45d672f5b3 Ignore Spock annotations when creating test context cache key
Closes gh-7524
8 years ago
Andy Wilkinson 3dcb2d5316 Merge branch '1.4.x' into 1.5.x 8 years ago
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
8 years ago
Aleksander Bartnikiewicz eb927f1b29 Prevent a broken factory bean from breaking the resetting of mocks
Closes gh-7271
8 years ago
Phillip Webb 88c84ce234 Merge branch '1.4.x' into 1.5.x 8 years ago
Phillip Webb a3b79be6b3 Support @MockBean on FactoryBeans
Update @MockBean support so that FactoryBean classes can be mocked.

Fixes gh-7439
8 years ago
Phillip Webb 1452d3cd51 Ensure withBasicAuth keeps error handler
Fix `TestRestTemplate` so that any custom `ErrorHandler` isn't lost
when calling `withBasicAuth`.

Fixes gh-7441
8 years ago
Phillip Webb 1657120286 Move ModifiedClassPathRunner to its own module
Migrate `ModifiedClassPathRunner` from `spring-boot` test source to
its own module.

Fixes gh-7420
8 years ago
Andy Wilkinson f35fa87366 Fix problems in SpringBootMockUtil reported by Checkstyle 8 years ago
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
8 years ago
Phillip Webb 7daf69a393 Upgrade to HTMLUnit 2.23 (+selenium module 2.23.2)
Fixes gh-7232
8 years ago
Spring Buildmaster e712a9ba8c Next Development Version 8 years ago
Stephane Nicoll eddb10e4c9 Merge branch '1.4.x' into 1.5.x 8 years ago
Stephane Nicoll 4603d8259a Make MockitoTestExecutionListener public
Closes gh-7016
8 years ago
Andy Wilkinson 3ea09d2e04 Merge branch '1.4.x' into 1.5.x 8 years ago
Andy Wilkinson 02e89acd1e Add managed version for kotlin-runtime to spring-boot-parent
See gh-7101
8 years ago
Andy Wilkinson f942fe4947 Merge branch '1.4.x' into 1.5.x 8 years ago
Andy Wilkinson 64d32191cf Ignore Kotlin annotations when creating test context cache key
Every classes that's compiled by Kotlin is annotated with
kotlin.Metadata. The attributes of this annotation always differ so
if they are used in the cache key, context caching will effectively
be disabled.

This commit updates the key used by ImportsContextCustomizer to
ignore the kotlin.Metadata annotation. Additionally, to align with
with Java where annotations in java.lang.annotation are ignored,
annotations in kotlin.annotation are also ignored.

Closes gh-7101
8 years ago
Phillip Webb d3e06c4627 Merge branch '1.4.x' into 1.5.x 8 years ago
Phillip Webb db3f488d5a Polish 8 years ago
Phillip Webb f2b0fa284e Merge branch '1.4.x' into 1.5.x 8 years ago
Madhura Bhave 16fe332f51 Fix NoClassDefFoundError when Mockito is missing
Update MockReset class to check for the presence of the MockUtil class
before attempting to use it.

Fixes gh-7065
8 years ago
Phillip Webb 3326841a97 Formatting 8 years ago
Phillip Webb f59cc25e2b Fix eclipse warnings 8 years ago
Stephane Nicoll e643fc5bd1 Merge branch '1.4.x' into 1.5.x 8 years ago