Commit Graph

868 Commits

Author SHA1 Message Date
Stephane Nicoll 2be0161f9a Fix bean type visibility
See gh-28437
2021-11-02 12:35:19 +01:00
Andy Wilkinson 84b553a8ca Upgrade to Jackson Bom 2.13.0
Closes gh-28298
2021-10-13 10:32:17 +01:00
Leo Li 1770f065a5 Polish
See gh-28239
2021-10-13 09:07:33 +02:00
Andy Wilkinson 1a505964ee Merge branch '2.5.x'
Closes gh-28207
2021-10-06 10:03:24 +01:00
Andy Wilkinson 1931104d13 Merge branch '2.4.x' into 2.5.x
Closes gh-28206
2021-10-06 09:57:19 +01:00
Andy Wilkinson 9c9fbf400e Upgrade to Spring Java Format 0.0.29
Closes gh-28205
2021-10-06 09:52:45 +01:00
Andy Wilkinson 575d83737a Merge branch '2.5.x'
Closes gh-27799
2021-08-23 13:27:22 +01:00
Andy Wilkinson e409489859 Merge branch '2.4.x' into 2.5.x
Closes gh-27798
2021-08-23 13:26:37 +01:00
Andy Wilkinson f8ef90813f Allow @MockBean to be used with Framework's @Repeat
Fixes gh-27693
2021-08-23 12:38:15 +01:00
Andy Wilkinson fd2fbcb3c6 Merge branch '2.5.x'
Closes gh-27758
2021-08-18 18:28:34 +01:00
Andy Wilkinson 6d8ba3e8b1 Merge branch '2.4.x' into 2.5.x
Closes gh-27757
2021-08-18 17:56:32 +01:00
Andy Wilkinson ffbd28b60a Polish "Polish access modifiers for test classes"
See gh-27736
2021-08-18 17:52:42 +01:00
izeye 8a425dedfd Polish access modifiers for test classes
See gh-27736
2021-08-18 17:38:40 +01:00
Andy Wilkinson 01e741d703 Prohibit circular references by default
Closes gh-27652
2021-08-17 14:51:39 +01:00
Andy Wilkinson 228e4e3bc8 Make it easier to add new config options to ApplicationContextRunners
Closes gh-27690
2021-08-17 14:51:08 +01:00
Andy Wilkinson e30bf0e3e5 Merge branch '2.5.x'
Closes gh-27528
2021-07-29 18:47:40 +01:00
Andy Wilkinson 43d623e696 Merge branch '2.4.x' into 2.5.x
Closes gh-27527
2021-07-29 18:47:31 +01:00
Andy Wilkinson 7eb5f35f2f Make WebTestClient creation back off when no HTTP client available
Fixes gh-27520
2021-07-29 18:45:53 +01:00
Andy Wilkinson 355226c21e Merge branch '2.5.x'
Closes gh-27474
2021-07-23 13:09:37 +01:00
Andy Wilkinson eaca9c7a83 Merge branch '2.4.x' into 2.5.x
Closes gh-27473
2021-07-23 13:09:27 +01:00
Andy Wilkinson ee07d6c3ca Increase response timeout for server-bound WebTestClients
Closes gh-27472
2021-07-23 13:06:25 +01:00
Andy Wilkinson 3e0baf1bfd Merge branch '2.5.x'
Closes gh-27353
2021-07-15 19:45:32 +01:00
Andy Wilkinson c8c784bd5c Allow @SpyBean to be used to spy on a Spring Data repository
Fixes gh-7033
2021-07-15 19:44:52 +01:00
Stephane Nicoll dc5acb0019 Remove deprecated code flagged for removal
Closes gh-27303
2021-07-14 11:50:01 +02:00
Stephane Nicoll 9e46061aa6 Allow to chain ContextConsumer implementations
Closes gh-26723
2021-06-11 16:04:34 +02:00
Phillip Webb 4d62e47c5d Merge branch '2.3.x' into 2.4.x 2021-06-08 18:05:12 -07:00
Phillip Webb 9e1c78da99 Update copyright year of changed files 2021-06-08 18:03:46 -07:00
Andy Wilkinson e317079446 Merge branch '2.4.x'
Closes gh-26524
2021-05-17 11:27:57 +01:00
Andy Wilkinson 49d362fd7f Merge branch '2.3.x' into 2.4.x
Closes gh-26523
2021-05-17 11:27:46 +01:00
weixsun 7f445630e4 Remove unnecessary semicolon
See gh-26446
2021-05-17 11:26:57 +01:00
Andy Wilkinson 05a64ecb2c Merge branch '2.4.x'
Closes gh-26522
2021-05-17 11:24:29 +01:00
Andy Wilkinson 2a2c68f8f2 Merge branch '2.3.x' into 2.4.x
Closes gh-26521
2021-05-17 11:22:48 +01:00
Andy Wilkinson be807bab12 Polish "Improve documentation of TestRestTemplate's fault tolerance"
See gh-26227
2021-05-17 11:07:42 +01:00
Carlos Rafael de Oliveira Carneiro a6fa8addb9 Improve documentation of TestRestTemplate's fault tolerance
See gh-26227
2021-05-17 11:07:42 +01:00
Stephane Nicoll d3c817b7ba Polish "Remove unnecessary throws declaration in tests"
See gh-26441
2021-05-17 09:36:53 +02:00
weixsun 8a2be288a3 Remove unnecessary throws declaration in tests
See gh-26441
2021-05-17 09:31:51 +02:00
Stephane Nicoll 691bbcfdfd Update copyright year of changed files
See gh-26448
2021-05-16 15:29:48 +02:00
weixsun d115361980 Remove redundant suppression
See gh-26448
2021-05-16 15:10:48 +02:00
Phillip Webb a28a3ae090 Merge branch '2.3.x' into 2.4.x 2021-03-30 09:25:46 -07:00
Phillip Webb 363f5829d1 Merge branch '2.3.x' into 2.4.x
Closes gh-25825
2021-03-29 15:46:50 -07:00
Phillip Webb 26dd1b9a26 Update deprecations with for removal targets
Update all deprecation tags to include a removal target.

Closes gh-25808
2021-03-29 15:44:58 -07:00
Phillip Webb 11a94ee6f0 Merge branch '2.3.x' into 2.4.x 2021-03-23 12:52:07 -07:00
Phillip Webb 82127fdaa3 Update copyright year of changed files 2021-03-23 12:50:49 -07:00
Andy Wilkinson 2f95c1e2c8 Merge branch '2.3.x' into 2.4.x
Closes gh-25513
2021-03-05 14:16:07 +00:00
Andy Wilkinson 22b73f3020 Polish "Improve documentaion of Mockito test execution listeners"
See gh-25375
2021-03-05 14:14:36 +00:00
dreis2211 1ccd8dae8a Allow the project to be built with Java 16
See gh-25171
2021-03-04 18:54:56 +00:00
Andy Wilkinson 297e3079d0 Fix handling of UriTemplateRequestEntity in TestRestTemplate
A change [1] in Spring Framework 5.3 means that getUrl() on a
RequestEntity will throw an UnsupportedOperationException if the
entity was created using a template.

This commit updates TestRestTemplate to check for instances of
UriTemplateRequestEntity and to resolve the URI using the
entity's UriTemplateHandler instead of calling getUrl() directly.

Fixes gh-25097

[1] a0f4d81db7
2021-02-04 10:59:00 +00:00
Andy Wilkinson 788a42d694 Merge branch '2.3.x' into 2.4.x
See gh-25076
2021-02-02 15:12:27 +00:00
Andy Wilkinson 67479b6380 Add junit-platform-launcher dependency by convention
Closes gh-25074
2021-02-02 13:03:21 +00:00
Phillip Webb d06407ec0a Update copyright year of changed files 2021-01-26 19:06:14 -08:00
Phillip Webb d95d7a0245 Update code for Spring Framework 5.3.4
See gh-24998
2021-01-26 17:35:54 -08:00
Madhura Bhave 920136d908 Merge branch '2.3.x' into 2.4.x
Closes gh-24678
2021-01-06 16:44:32 -08:00
Madhura Bhave 73a2a4b383 Consider context-path for WebTestClient baseUrl
Fixes gh-24168
2021-01-06 16:42:09 -08:00
dreis2211 fb207f73e7 Remove deprecated SpringBootContextLoader#getArgs()
See gh-24550
2020-12-21 09:44:28 +01:00
Phillip Webb d6890e39a7 Merge branch '2.3.x' into 2.4.x
Closes gh-24536
2020-12-16 13:10:35 -08:00
dreis2211 0ec603cdad Avoid duplicates in MergedContextConfiguration
Remove duplicate config attribute classes by using a `Set` rather
than a `List` in the `SpringBootTestContextBootstrapper`.

See gh-24532
2020-12-16 12:50:54 -08:00
Phillip Webb 72d36e0c07 Update copyright year of changed files 2020-12-10 10:46:04 -08:00
Phillip Webb 30c27274e2 Merge branch '2.3.x'
Closes gh-24339
2020-12-04 18:31:55 -08:00
Phillip Webb 5f351a6983 Merge branch '2.2.x' into 2.3.x
Closes gh-24338
2020-12-04 18:21:57 -08:00
Phillip Webb 837fc83527 Fix checkstyle header violations
See gh-24337
2020-12-04 18:05:53 -08:00
Stephane Nicoll f248cfe79c Polish "Check that WebClient is available"
See gh-24152
2020-11-25 14:52:47 +01:00
Tobias Gesellchen f6255cc691 Check that WebClient is available
This commit reinstanties the isWeBClientPresent() check so that
WebTestClientContextCustomizer is only added if a web client is
available.

See gh-24152
2020-11-25 14:38:42 +01:00
Andy Wilkinson d41e739f8c Merge branch '2.3.x'
Closes gh-24013
2020-11-03 14:58:41 +00:00
Andy Wilkinson dc86e8ce30 Merge branch '2.2.x' into 2.3.x
Closes gh-24012
2020-11-03 14:58:28 +00:00
Andy Wilkinson 6548ca4c11 Implement equals and hashCode in TestTypeExcludeFilter
Fixes gh-23978
2020-11-03 14:50:00 +00:00
Phillip Webb 929d8fcd3c Update copyright year of changed files 2020-10-29 09:08:13 -07:00
Andy Wilkinson 506f7acc8d Streamline use of TestContextAnnotationUtils
See gh-12470
2020-10-28 10:20:14 +00:00
Andy Wilkinson d9084eab67 Provide Mockito with a MockResolver that removes Spring-created proxies 2020-10-28 09:43:09 +00:00
Andy Wilkinson 6b437ece54 Inherit enclosing class's configuration in nested tests
Fixes gh-12470
2020-10-28 08:56:42 +00:00
Phillip Webb e790828e19 Allow TestPropertyValues.of to take a Map source
Extend the API of `TestPropertyValues` so that it can be constructed
from an existing `Map` or a `Stream` and mapping `Function`.

Closes gh-23685
2020-10-23 12:00:25 -07:00
Andy Wilkinson 2d8528d5bd Adapt to deprecation of StringUtils.isEmpty(Object)
See gh-23774
2020-10-22 17:09:33 +01:00
Andy Wilkinson 98914b65bc Merge branch '2.3.x'
Closes gh-23672
2020-10-13 11:23:00 +01:00
Andy Wilkinson a9a32f39b5 Merge branch '2.2.x' into 2.3.x
Closes gh-23671
2020-10-13 11:20:18 +01:00
Andy Wilkinson 667ccdae84 Simplify temp directory creation and improve diagnostics
Closes gh-23622
2020-10-13 11:18:06 +01:00
Andy Wilkinson 7b183ef99d Merge branch '2.3.x'
Closes gh-23478
2020-09-24 14:46:42 +01:00
Andy Wilkinson e626f7f47e Merge branch '2.2.x' into 2.3.x
Closes gh-23477
2020-09-24 14:45:55 +01:00
Andy Wilkinson bf9d23e55a Consider SpringBootTest's web environment in context cache key
Previously, the web environment configured on `@SpringBootTest` was not
part of the context cache key. As a result, two test classes that has
identical configuration other than one using a MOCK web environment and
the other using a DEFINED_PORT web environment would share a context
when they should not do so. Classes that use MOCK and RANDOM_PORT were
not affected as the use of RANDOM_PORT results in a property for the
port being added to the environment.

This commit adds a new ContextCustomizer, SpringBootTestWebEnvironment,
that is used to capture the `webEnvironment` from `@SpringBootTest`
and use it in its hashCode and equals implementations. This fixes the
problem as all context customizers are evaluated when determing the
equality of two context cache keys.

Fixes gh-23085
2020-09-24 14:43:51 +01:00
Phillip Webb 1ae1436211 Refactor BootstrapRegistry support
Refactor `BootstrapRegistry` support following initial prototype work
with the Spring Cloud team.

This update splits the `BootstrapRegistry` API into `BootstrapRegistry`,
`BootstrapContext` and  `ConfigurableBootstrapContext` interfaces and
moves it to the same package as `SpringApplication`.

A new `Bootstrapper` interface has been introduced that can be added
to the `SpringApplication` to customize the `BootstrapRegistry` before
it's used.

Closes gh-23326
2020-09-17 00:31:00 -07:00
Phillip Webb 6509310fdb Fix DefaultPropertiesPropertySource package tangle
Relocate `DefaultPropertiesPropertySource` to fix a package tangle.

Closes gh-23383
2020-09-17 00:31:00 -07:00
Stephane Nicoll 91cc283c39 Upgrade to JUnit Jupiter 5.7.0
Closes gh-23351
2020-09-16 13:28:31 +02:00
Phillip Webb d123c924a0 Add BootstrapRegisty support for config data
Expose the `BootstrapRegisty` to both `ConfigDataLocationResolver` and
`ConfigDataLoader` implementations. The registry is exposed via the
context interfaces and may be used to reuse instances that are expensive
to create. It may also be used to ultimately register beans with the
`ApplicationContext`.

Closes gh-22956
2020-08-20 21:49:03 -07:00
Andy Wilkinson 969dd35e45 Upgrade to Mockito 3.4.6
Closes gh-22838
2020-08-10 15:22:03 +01:00
Phillip Webb f8c8b65cbf Add ConfigDataEnvironmentPostProcessor.applyTo
Add static methods to `ConfigDataEnvironmentPostProcessor` so that
post-processing can be applied to `Environment` instances directly.

Closes gh-22601
2020-08-06 14:35:43 -07:00
Phillip Webb 8d06b0f368 Merge branch '2.3.x' 2020-08-06 10:15:36 -07:00
Phillip Webb 4924573074 Merge branch '2.2.x' into 2.3.x 2020-08-06 10:15:22 -07:00
Phillip Webb fdd6a89a61 Polish 2020-08-06 10:14:01 -07:00
Brian Clozel fb1234a22c Upgrade to Reactor 2020.0.0 SNAPSHOTs
See gh-22667
2020-08-04 13:26:47 +02:00
Andy Wilkinson d16838e4b7 Merge branch '2.3.x'
Closes gh-22584
2020-07-27 13:08:40 +01:00
Andy Wilkinson 39cb912819 Merge branch '2.2.x' into 2.3.x
Closes gh-22583
2020-07-27 13:08:14 +01:00
Andy Wilkinson 41954533b2 Fix Mock|SpyBean context caching
The fix for gh-20916 updated DefinitionsParser so that the
ResolvableType for each MockBean or SpyBean field included the
implementation class from which the field was found. Where the field
was declared with a variable generic signature that was made constant
by its implementation class, this allowed the correct concrete type to
be determined. It also had the unintended side-effect of preventing two
test classes with identical `@MockBean` and `@SpyBean` configuration
from sharing a context as the resolvable types for their mock and spy
bean fields would now be different.

This commit updates DefinitionsParser to only include the
implementation class in the ResolvableType if the field's generic type
is variable. For cases where it is not variable, this restores the
behaviour prior to the fix for gh-20916.

Fixes gh-22566
2020-07-27 13:04:02 +01:00
Phillip Webb 3352024b1c Provide ConfigFileApplicationListener replacement
Deprecate `ConfigFileApplicationListener` and provide a replacement
mechanism that supports arbitrary config data imports.

This commit updates the following areas:

- Extract `EnvironmentPostProcessor` invocation logic from the
  `ConfigFileApplicationListener` to new dedicated listener. Also
  providing support for `Log` injection.

- Extract `RandomPropertySource` adding logic from the
  `ConfigFileApplicationListener` to a dedicated class.

- Migrate to the recently introduced `DefaultPropertiesPropertySource`
  class when moving the defaultProperties `PropertySource`

- Replace processing logic with a phased approach to ensure that
  profile enablement happens in a distinct phase and that profiles
  can no longer be activated on an ad-hoc basis.

- Provide a more predictable and logical import order for processing
  `application.properties` and `application.yml` files.

- Add support for a `spring.config.import` property which can be used
  to import additional config data. Also provide a pluggable API
  allowing third-parties to resolve and load locations themselves.

- Add `spring.config.activate.on-profile` support which replaces the
  existing `spring.profiles` property.

- Add `spring.config.activate.on-cloud-platform` support which allows
  a config data document to be active only on a given cloud platform.

- Support a `spring.config.use-legacy-processing` property allowing the
  previous processing logic to be used.

Closes gh-22497

Co-authored-by: Madhura Bhave <mbhave@vmware.com>
2020-07-22 21:02:32 -07:00
Phillip Webb 14c1b0938a Polish 2020-07-22 18:25:27 -07:00
Phillip Webb da69286838 Merge branch '2.3.x' 2020-07-22 17:39:27 -07:00
Phillip Webb 217b2eff89 Merge branch '2.2.x' into 2.3.x 2020-07-22 17:03:23 -07:00
Phillip Webb b5e70157dc Update copyright year of changed files 2020-07-22 17:01:36 -07:00
Andy Wilkinson 0c8e52e877 Avoid using reflection to create SpringApplication's context
Closes gh-22322
2020-07-16 15:03:08 +01:00
XenoAmess 66dc24062f Fix typos in test code
See gh-22218
2020-07-07 10:01:48 +01:00
Andy Wilkinson 27c458ca26 Merge branch '2.3.x'
Closes gh-22160
2020-06-30 10:53:49 +01:00
Andy Wilkinson f86831da9c Use TCCL at time of access for resource loading
Fixes gh-22119
2020-06-30 10:51:13 +01:00
Andy Wilkinson 0d6ea79007 Start building against Spring Framework 5.3.0 snapshots
See gh-21929
2020-06-22 18:02:21 +01:00
Madhura Bhave f47e06c4ef Merge branch '2.3.x'
Closes gh-22007
2020-06-17 17:27:10 -07:00
Madhura Bhave f4ad30c448 Merge branch '2.2.x' into 2.3.x
Closes gh-22006
2020-06-17 17:26:40 -07:00
Madhura Bhave 615cf63a82 Make MockBean resolve right type for abstract test class
Fixes gh-20916
2020-06-17 17:25:03 -07:00
Andy Wilkinson 9e08490522 Merge branch 'gh-21271'
Closes gh-21271
2020-06-16 12:52:17 +01:00
Andy Wilkinson 753bea64c6 Enable varargs compilation warnings
See gh-21271
2020-06-16 12:50:53 +01:00
Andy Wilkinson 056d5f3120 Enable deprecation compilation warnings
See gh-21271
2020-06-16 12:50:47 +01:00
Andy Wilkinson 0de466e06e Require dependency on s-b-dependencies to use its constraints
Previously, Spring Boot's modules published Gradle Module Metadata
(GMM) the declared a platform dependency on spring-boot-dependencies.
This provided versions for each module's own dependencies but also had
they unwanted side-effect of pulling in spring-boot-dependencies
constraints which would influence the version of other dependencies
declared in the same configuration. This was undesirable as users
should be able to opt in to this level of dependency management, either
by using the dependency management plugin or by using Gradle's built-in
support via a platform dependency on spring-boot-dependencies.

This commit reworks how Spring Boot's build uses
spring-boot-dependencies and spring-boot-parent to provide its own
dependency management. Configurations that aren't seen by consumers are
configured to extend a dependencyManagement configuration that has an
enforced platform dependency on spring-boot-parent. This enforces
spring-boot-parent's version constraints on Spring Boot's build without
making them visible to consumers. To ensure that the versions that
Spring Boot has been built against are visible to consumers, the
Maven publication that produces pom files and GMM for the published
modules is configured to use the resolved versions from the module's
runtime classpath.

Fixes gh-21911
2020-06-16 08:50:21 +01:00
Phillip Webb 0a05b4c9fd Update copyright year of changed files 2020-06-05 15:36:09 -07:00
Andy Wilkinson daeca9f332 Restore Boot 2.2's compile-scoped dependencies
Fixes gh-21507
2020-06-03 12:55:11 +01:00
Phillip Webb 038ae93406 Update copyright year of changed files 2020-05-13 16:48:51 -07:00
Phillip Webb 49921d65ac Ensure @ActiveProfiles replaces existing profiles
Update `SpringBootContextLoader` to both add `spring.profiles.active`
properties and to directly call `Environment.setActiveProfiles`.
The additional `setActiveProfiles` call prevents `AbstractEnvironment`
from accidentally loading `spring.profiles.active` properties directly
when `doGetActiveProfiles` is called.

Directly setting active profiles has only become necessary since we
started adding properties using the square bracket notation. Previously
we added a comma-separated list which would be picked up by both the
`AbstractEnvironment` and the `ConfigurationFileApplicationListener`.

Closes gh-21302
2020-05-08 17:16:06 -07:00
Stephane Nicoll 846db6105f Merge branch '2.2.x'
Closes gh-21364
2020-05-08 14:51:49 +02:00
Stephane Nicoll 60ff8bafb5 Polish "Align TestRestTemplate Javadoc with documentation"
See gh-21318
2020-05-08 14:49:50 +02:00
Andrii Hrytsiuk f11c030b71 Align TestRestTemplate Javadoc with documentation
See gh-21318
2020-05-08 14:48:21 +02:00
Phillip Webb ad1248e4ec Replace "folder" with "directory"
Consistently use the term "directory" instead of "folder"

Closes gh-21218
2020-04-28 19:20:24 -07:00
dreis2211 c7d7facc3a Remove empty test rule package
See gh-21137
2020-04-27 10:32:44 +02:00
Stephane Nicoll c7baf5fda1 Update copyright year of changed file
See gh-21009
2020-04-25 08:55:27 +02:00
dreis2211 5eb5bf0a2d Polish
See gh-21009
2020-04-25 08:54:47 +02:00
Stephane Nicoll 85e9f713b0 Update copyright year of changed files
See gh-21007
2020-04-25 08:50:51 +02:00
Johnny Lim 29717423a3 Remove this keyword on member method invocations
See gh-21007
2020-04-25 08:49:44 +02:00
Phillip Webb b73d5038d5 Merge branch '2.2.x' 2020-04-23 14:35:08 -07:00
Phillip Webb 9bb53a4c37 Polish 2020-04-23 14:31:49 -07:00
Madhura Bhave b3ccefdb57 Merge branch '2.2.x'
Closes gh-21102
2020-04-23 10:19:10 -07:00
Madhura Bhave 4dc9bbe127 @SpringBootTest classes with different args shouldn't share a context
Fixes gh-20866
2020-04-23 10:18:14 -07:00
Madhura Bhave 21bb249a73 Merge branch '2.2.x'
Closes gh-21090
2020-04-22 14:36:36 -07:00
Madhura Bhave b9c2b7b257 Prevent early initialization in MockitoPostProcessor
Fixes gh-20665
2020-04-22 14:35:50 -07:00
Phillip Webb 7ab2bca376 Support commas in @ActiveProfiles
Update `SpringBootContextLoader` so that it correctly deals with an
`@ActiveProfiles` annotation that contains a comma.

Fixes gh-19537

Co-authored-by: Scott Frederick <sfrederick@pivotal.io>
Co-authored-by: Andy Wilkinson <awilkinson@pivotal.io>
2020-04-17 18:47:56 -07:00
Phillip Webb 3ca896e63f Polish 2020-04-07 12:10:49 -07:00
Stephane Nicoll f4c68dbc98 Do not set server.port=-1 for non embedded tests
Closes gh-16998
2020-04-02 18:12:39 +02:00
dreis2211 674f1e77b5 Fix typos
See gh-20704
2020-03-28 08:42:59 +01:00
dreis2211 ef9f1d39a3 Remove redundant MockitoAnnotations.initMocks()
See gh-20601
2020-03-22 08:43:50 +01:00
dreis2211 a9dabe13bb Remove redundant useJUnitPlatform declarations
See gh-20206
2020-02-17 09:15:57 +01:00
dreis2211 20251ccae4 Remove superfluous useJUnit()
See gh-20035
2020-02-06 16:54:51 +01:00
Phillip Webb 1eee83a07e Update copyright year of changed files 2020-01-30 17:09:49 -08:00
Stephane Nicoll eb852f1ad6 Disable bean overriding by default in ApplicationContextRunner
For consistency with SpringApplication, this commit disables bean
overriding by default in ApplicationContextRunner. Bean overriding can
be enabled again using withAllowBeanDefinitionOverriding.

Closes gh-18019
2020-01-28 15:57:28 +01:00
Stephane Nicoll 95be419527 Use Class.forName rather than ClassLoader.loadClass
This commit changes uses of ClassLoader.loadClass to Class.forName for
consistency with what was initiated in #19342 and better compatibility
with GraalVM.

Closes gh-19824
2020-01-23 10:47:53 +01:00
Phillip Webb e0013454b5 Use parentheses when declaring dependencies
Update all dependencies declarations to use the form `scope(reference)`
rather than `scope reference`.

Prior to this commit we declared dependencies without parentheses unless
we were forced to add them due to an `exclude`.
2020-01-22 16:02:38 -08:00
Phillip Webb 0209cd3e4c Polish quote form used in Gradle scripts
Replace Gradle single quote strings with the double quote form
whenever possible. The change helps to being consistency to the
dependencies section where mostly single quotes were used, but
occasionally double quotes were required due to `${}` references.
2020-01-22 15:49:52 -08:00
dreis2211 042694bc53 Reinstate running of OutputCaptureRuleTests
See gh-19826
2020-01-21 09:47:41 +01:00
Andy Wilkinson 29d8b6db5a Merge branch '2.2.x'
Closes gh-19822
2020-01-20 15:18:18 +00:00
Andy Wilkinson f708aace65 Merge branch '2.1.x' into 2.2.x
Fixes gh-19821
2020-01-20 15:18:00 +00:00
Andy Wilkinson c85f19b75b Revert "Add profiles directly to the application environment for tests"
This reverts commit 487b9cbf96.

Fixes gh-19788
2020-01-20 15:01:09 +00:00
Scott Frederick 8f102aee68 Remove deprecated 2.2 code
See gh-19699
2020-01-16 14:44:52 +01:00
Andy Wilkinson 714a187d8f Rework dep mgmt again to avoid consumers picking up strict constraints
This paves the way for publishing Gradle module metadata once the
problem caused by snapshot versions and our two-step publication
process has been addressed.

See gh-19609
2020-01-15 12:33:18 +00:00
Andy Wilkinson aefe52e4d0 Revert "Rework dep management to avoid consumers picking up strict constraints"
This reverts commit b34a311d02 as,
having disabled the publishing of Gradle's module metadata (4f75ab5),
the changes are no longer needed.

See gh-19609
2020-01-14 12:15:53 +00:00
Phillip Webb f57281340c Merge branch '2.2.x' 2020-01-13 16:46:49 -08:00
Phillip Webb 3cfbfebbb1 Merge branch '2.1.x' into 2.2.x 2020-01-13 16:45:40 -08:00
Phillip Webb 9bd49562fe Update copyright year of changed files 2020-01-13 14:09:11 -08:00
Andy Wilkinson b34a311d02 Rework dep management to avoid consumers picking up strict constraints
Previously, enforcedPlatform dependencies were using to pull in the
constraints defined in spring-boot-dependencies and
spring-boot-parent and applied them strictly so that the constrained
version had to be used. This worked as intended in Spring Boot's own
build but incorrectly enforced those same strict version requirements
on external consumers of Spring Boot's modules.

This commit reworks how Spring Boot defines its internal dependency
management so that platform dependencies are exposed to external
consumers while enforced platform dependencies are using internally.

See gh-19609
2020-01-13 19:59:56 +00:00
Andy Wilkinson ce99db1902 Port the build to Gradle
Closes gh-19609
Closes gh-19608
2020-01-10 14:15:35 +00:00
Madhura Bhave 6944e52052 Merge branch '2.2.x' 2020-01-07 13:49:43 -08:00
Madhura Bhave ac10ebba33 Fix checkstyle 2020-01-07 13:49:02 -08:00
Madhura Bhave c82d728c93 Merge branch '2.2.x'
Closes gh-19561
2020-01-07 13:34:43 -08:00
Madhura Bhave 67fab60fbd Merge branch '2.1.x' into 2.2.x
Closes gh-19560
2020-01-07 13:33:32 -08:00
Scott Frederick 487b9cbf96 Add profiles directly to the application environment for tests
Prior to this commit, active profiles were being added to the Spring Boot
application environment by setting the `spring.profiles.active` property.
This could result in profiles getting parsed differently than other uses of `@ActiveProfiles`.
Setting the profiles directly in the `Environment` prevents this parsing.

See gh-19556
2020-01-07 13:23:09 -08:00
Stephane Nicoll 2c1e81adf0 Polish 2019-12-26 10:42:40 +01:00
Andy Wilkinson 9b0569cf81 Merge branch '2.1.x' into 2.2.x
Closes gh-19309
2019-12-05 16:15:15 +00:00
Andy Wilkinson bc53fe0344 Recommend mockito-inline for mocking and spying of CGLib proxies
This reverts commit 52050c173c.

See gh-17817
Closes gh-19020
2019-12-05 16:13:02 +00:00
Stephane Nicoll fd94608f73 Polish "Restore proxying of @Bean methods in @TestConfiguration"
See gh-18675
2019-10-22 09:13:00 +02:00
Dmytro Nosan 7faa606920 Restore proxying of @Bean methods in @TestConfiguration
See gh-18675
2019-10-22 09:10:05 +02:00
Stephane Nicoll 0bc5803e34 Merge branch '2.1.x'
Closes gh-18603
2019-10-15 14:38:59 +02:00
Stephane Nicoll e4ba6049ff Clarify scope of "@SpringBootTest#classes"
See gh-18229
2019-10-15 14:36:28 +02:00
Johnny Lim 887c3b71f3 Fix matchesNestedConfigurationClassWithoutTestMethodsIfItHasTestable()
See gh-18559
2019-10-12 16:51:53 +01:00
Andy Wilkinson 96f85a40de Support customization of WebTestClient.Builder when using @SpringBootTest
Closes gh-15132
2019-10-02 17:51:00 +01:00
Andy Wilkinson 46c30d6bb0 Merge branch '2.1.x'
Closes gh-18476
2019-10-02 10:48:57 +01:00
Andy Wilkinson 3d4157ad6d Correct SCM URLs in published poms
Previously, Maven's default behaviour was relied up which resulted
in the artifact ID being appended to each URL as it was inherited.
This behaviour can only be disabled in Maven 3.6 and later, a version
that we cannot use due to an incompatibility with the Flatten Plugin.

This commit works around Maven's default behaviour by defining
properties for the SCM URL, connection, and developer connection and
then explicitly defining the settings in each pom using these
properties. The explicit definition of the properties in each pom
prevents them being inherited from the parent, thereby disabling the
unwanted appending of the artifact ID to the URL.

Fixes gh-18328
2019-10-02 10:48:30 +01:00
Phillip Webb b65ba60980 Polish 'Simplify some code'
See gh-18438
2019-10-01 22:08:20 -07:00
kenneth e6b45de41e Simplify some code
See gh-18438
2019-10-01 22:08:02 -07:00
Stephane Nicoll c605419f19 Merge branch '2.1.x'
Closes gh-18379
2019-09-27 16:34:59 +02:00
Roland Weisleder 92ae7b21a1 Fix typo in ApplicationContextAssert
See gh-18372
2019-09-27 16:32:32 +02:00
Phillip Webb ad32603635 Restore compatibility with MockRestServiceServer
Closes gh-17885
2019-09-16 10:17:41 +02:00
Stephane Nicoll 3d5530d15d Merge branch '2.1.x'
Closes gh-18234
2019-09-16 10:03:19 +02:00
Stephane Nicoll 9065c4997d Fix rebase from master 2019-09-16 09:52:55 +02:00
Stephane Nicoll e05f42f0f3 Polish Add Testable to CLASS_ANNOTATIONS in TestTypeExcludeFilter"
See gh-18214
2019-09-16 09:44:01 +02:00
Leonard Brünings b9c8d7dd60 Add Testable to CLASS_ANNOTATIONS in TestTypeExcludeFilter
See gh-18214
2019-09-16 09:42:55 +02:00
dreis2211 b4350a9d96 Remove unnecessary blank lines
See gh-18089
2019-09-03 08:48:10 +02:00
dreis2211 3e35a6616c Fix duplicated words
See gh-18004
2019-09-01 09:09:38 +02:00
Andy Wilkinson ba6fe60134 Merge branch '2.1.x'
Closes gh-17948
2019-08-23 19:15:02 +01:00
Andy Wilkinson 52050c173c Fix spying on scoped beans with @SpyBean
Previously, when spying on a scoped bean the creation of the spy
would be performed using the scoped proxy. This would result in
the spy being unable to spy on any of the target bean's methods as
the scoped proxy's implementations of those methods would be final.

This commit updates MockitoPostProcessor so that the creation of the
spy and injection of the @SpyBean-annotated field is performed using
the scoped target. The scoped target has not be proxied so this
allows Mockito to spy on all of its methods.

Closes gh-17817
2019-08-23 19:03:08 +01:00
Andy Wilkinson ab87b2a39b Polish 2019-08-19 16:05:43 +01:00
dreis2211 d4affd7f85 Use hasSize() assertion in favor of length checks
See gh-17874
2019-08-17 06:39:41 +02:00
Phillip Webb 34c31ce099 Remove BeanTypeRegistry
Remove `BeanTypeRegistry` and rely entirely on standard calls Spring
Framework APIs.

Closes gh-17594
2019-08-01 10:15:15 +01:00
Phillip Webb da4f436140 Change SearchStrategy EXHAUSTIVE to TYPE_HIERARCHY
Fixup references following upstream Spring Framework change.
2019-07-31 15:11:43 +01:00
dreis2211 8d2f2b75bd Upgrade to AssertJ 3.13.1
See gh-17690
2019-07-30 09:48:33 +02:00
Phillip Webb 8bc780762a Merge branch '2.1.x' 2019-07-24 11:42:48 +01:00
Phillip Webb fb1dd8fe93 Merge branch '2.0.x' into 2.1.x 2019-07-24 11:41:32 +01:00
Phillip Webb 913e831f4e Merge '1.5.x' into 2.0.x 2019-07-24 11:39:58 +01:00
Phillip Webb 6c0dbacfce Polish 2019-07-23 15:43:51 +01:00
Phillip Webb 0d92af7d55 Add hasJsonPath and doesNotHaveJsonPath asserts
Extend `JsonContentAssert` with `hasJsonPath` and `doesNotHaveJsonPath`
methods which can be used to check the path regardless of the value it
may or may not contain.

Prior to this commit there wasn't an easy way to assert that the
Jackson `@JsonInclude(JsonInclude.Include.NON_NULL)` annotation was
applied since `assertDoesNotHavePathValue` would pass for both
`{"name" : null}` and `{}`.

Closes gh-17608
2019-07-23 15:43:51 +01:00
Phillip Webb 900ec9f3ec Fix error message formatting placeholders
Fix the formatting message placeholders to '%s' since '{}' isn't
supported by AssertJ.

See gh-15569
2019-07-23 15:43:51 +01:00
Andy Wilkinson 41957ec2ad Polish "Polish OutputCapture and its JUnit Jupiter extension"
See gh-17049
2019-07-18 17:46:56 +01:00
Sam Brannen e1c595a67f Polish OutputCapture and its JUnit Jupiter extension
- Polish Javadoc
- Improve error message in OutputCapture
- Use ExtensionContext.Store in OutputCaptureExtension

See gh-17049
2019-07-18 17:46:55 +01:00
Phillip Webb a9ba7080ce Merge branch '2.1.x' 2019-07-17 21:48:42 +01:00
Phillip Webb eff1147ccc Rename classpath runner package
Remove `runner` since we're no longer tied to JUnit 4.

See gh-17491
2019-07-15 13:40:26 +01:00
Phillip Webb 1117fdb2b3 Make ModifiedClassPathExtension package private
Meta-annotate `ClassPathExclusions` and `ClassPathOverrides` with
so that the `ModifiedClassPathExtension` no longer needs to be
used directly.

See gh-17491
2019-07-15 13:38:26 +01:00
dreis2211 0f0278e69b Migrate ModifiedClassPath tests to JUnit 5
Migrate the remaining JUnit 4 tests to JUnit 5, making use of the
new `ModifiedClassPathExtension`.

See gh-17491
2019-07-15 00:31:03 +01:00
Phillip Webb 0cb6a7f47d Polish 2019-07-15 00:24:19 +01:00
Phillip Webb 01933f9b06 Merge previously split strings
Merge some string lines that were previously split because of the
90 chars wide formatting.
2019-07-15 00:24:19 +01:00
Phillip Webb cdf43a7489 Polish 2019-07-14 19:42:56 +01:00
Phillip Webb 8d4a2add63 Allow OutputCaptureRule to be used with AssertJ
Update `OutputCaptureRule` so that it now implements
`CapturedOutput` and can be used directly with AssertJ.

Closes gh-17512
2019-07-14 19:42:42 +01:00
dreis2211 82047a2544 Polish
See gh-17505
2019-07-14 11:38:40 +02:00
Johnny Lim 426ef749db Polish
See gh-17413
2019-07-09 07:40:30 +02:00
Andy Wilkinson 2816635418 Polish 2019-07-04 17:51:20 +01:00
Phillip Webb a66c4d3096 Unify method visibility of private classes
Apply checkstyle rule to ensure that private and package private
classes do not have unnecessary public methods. Test classes have
also been unified as much as possible to use default scoped
inner-classes.

Closes gh-7316
2019-07-03 11:39:47 -07:00
Phillip Webb 605599138e Merge branch '2.1.x' 2019-06-28 23:56:02 -07:00
Phillip Webb 92bff3c328 Merge branch '2.0.x' into 2.1.x 2019-06-28 23:42:28 -07:00
Phillip Webb cfeb0239b7 Merge branch '1.5.x' into 2.0.x 2019-06-28 23:28:34 -07:00
Stephane Nicoll e560b7f6ba Remove public modifier on JUnit5 lifecycle methods
See gh-17292
2019-06-21 18:09:05 +02:00
Andy Wilkinson a189e4cf96 Merge branch '2.1.x'
Closes gh-17220
2019-06-17 14:05:16 +01:00
Andy Wilkinson 645514f848 Polish "Honour base path from @WebAppConfiguration in @WebMvcTest"
See gh-16485
2019-06-17 13:54:41 +01:00
Lorenzo Dee 7340d546b8 Honour base path from @WebAppConfiguration in @WebMvcTest
See gh-16485
2019-06-17 13:37:55 +01:00
Madhura Bhave 30cfe7b4c5 Polish 2019-06-13 08:02:26 -07:00
Phillip Webb aad21d1996 Polish "Support default headers with RestTemplateBuilder"
Broaden the scope of customizer support so that instead of focusing
just on headers, we can now customize any outgoing `HttpClientRequest`.
Also update auto-configuration to automatically add any
`RestTemplateRequestCustomizer` beans to the builder.

See gh-17091
2019-06-12 16:34:31 -07:00
Ilya Lukyanovich 43b1a667ce Support default headers with RestTemplateBuilder
Update `RestTemplateBuilder` so that it is easier to apply custom
headers to the outgoing request. The update is particularly useful
for setting the `User-Agent` header, for example so that a GitHub
username can be used when calling `api.github.com`.

See gh-17091
2019-06-12 13:49:39 -07:00
Phillip Webb 266d6334b2 Fix checkstyle RedundantModifier test violations 2019-06-07 20:46:33 -07:00
Andy Wilkinson b18fffaf14 Move tests to JUnit 5 wherever possible 2019-06-07 12:25:54 +01:00
Andy Wilkinson aef92b9295 Merge branch '2.1.x'
Closes gh-17079
2019-06-07 11:00:44 +01:00
Andy Wilkinson 24925c3dae Merge branch '2.0.x' into 2.1.x
Closes gh-17078
2019-06-07 10:50:34 +01:00
Andy Wilkinson c6c139d980 Merge branch '1.5.x' into 2.0.x 2019-06-07 10:46:31 +01:00
Phillip Webb db75347eb6 Merge branch '2.1.x' 2019-06-04 14:41:20 -07:00
Phillip Webb 0ef331018e Merge branch '2.0.x' into 2.1.x 2019-06-04 14:30:52 -07:00
Phillip Webb 7fc01971ed Merge branch '1.5.x' into 2.0.x 2019-06-04 14:20:25 -07:00
Phillip Webb 76e075ddd0 Polish "Use request factory to support Basic Authentication"
Reduce the surface area of the public API by making the
`BasicAuthentication` and `BasicAuthenticationClientHttpRequestFactory`
class package private.

This commit also attempts to simplify `TestRestTemplate` by keeping
the `RestTemplateBuilder` and reusing it, rather than needing to deal
only with a `RestTemplate` instance.

See gh-17010
2019-05-31 22:35:36 -07:00
Dmytro Nosan 18a0a7a2e8 Use request factory to support Basic Authentication
Update `RestTemplateBuilder` to use a custom request factory to add
authentication headers rather than an interceptor.

Prior to this commit, the use of the `BasicAuthenticationInterceptor`
interceptor could cause `OutOfMemoryError` whenever a large file is
uploaded.

See gh-17010
2019-05-31 22:29:20 -07:00
Madhura Bhave 898a903d2f Fix typos in javadoc 2019-05-31 15:18:29 -07:00
Andy Wilkinson 0644a79401 Repackage output capture and always use extension declaratively
Closes gh-17029
2019-05-31 18:33:10 +01:00
Phillip Webb d11d5ceb29 Split up JUnit 5 OutputCapture class
Split the JUnit 5 `OutputCapture` class into separate `OutputExtension`
and `CapturedOutput` classes. The JUnit 5 callback methods are now
contained only in the `OutputExtension` class so no longer pollute the
public API that users will interact with.

The `CapturedOutput` class has also been updated to capture System.err
and System.out separately to allow distinct assertions if required.

Closes gh-17029
2019-05-30 23:44:35 -07:00
Phillip Webb 68aec8b6ee Polish 2019-05-30 11:30:27 -07:00
Andy Wilkinson 86380ab8db Add missing package-info.java files 2019-05-29 07:20:34 +01:00
Johnny Lim d8e5169f5f Polish
Closes gh-16948
2019-05-25 11:28:23 +02:00
Andy Wilkinson 23f803c6b6 Upgrade to Hamcrest 2.1, switch to hamcrest artifact from -core and -library
Closes gh-15555
2019-05-22 14:50:15 +01:00
dreis2211 27ca7e17d9 Fix deprecated StandardAnnotationMetadata usages
Closes gh-16930
2019-05-22 14:05:15 +02:00
Phillip Webb ed998ef0d3 Update copyright header of changed files 2019-05-14 21:04:50 -07:00
Andy Wilkinson 552345fcd1 Disable more @Bean method proxying
Previously, due to a quirk in Spring Framework, it was necessary to use bean method
proxying in @Configuration classes that define one or more FactoryBeans. This quirk has
now been addressed so this commit disables bean method proxying where it is now no longer
needed.

Closes gh-16533
2019-05-10 10:16:22 +01:00
Andy Wilkinson ca51609cdf Align mock with Selenium HtmlUnit's new behaviour
See gh-16801
2019-05-09 09:48:36 +01:00
Madhura Bhave 1db1c8b03c Validate our own tests work with JUnit5 and the vintage engine
Closes gh-14737

Co-authored-by: Stephane Nicoll <snicoll@pivotal.io>
2019-05-08 16:05:44 +02:00
Madhura Bhave d15347d4e5 Add Junit5 OutputCapture Extension
Closes gh-14738
2019-05-08 16:05:43 +02:00
Stephane Nicoll c91578bbae Define surefire test provider to use
The `spring-boot-test` module has a dependency to TestNG to validate
some part of the test infrastructure but no tests are actually written
using TestNG. The presence of TestNG is a trigger for the maven surefire
plugin and it attempts to run tests using it.

This commit defines the explicit provider to use (JUnit 4)

Closes gh-16735
2019-05-07 14:22:53 +02:00
Phillip Webb 32040e355b Merge branch '2.1.x'
Closes gh-16649
2019-04-24 19:50:41 -07:00
Phillip Webb d4151e0b51 Polish "Use Jackson configuration with JsonPath"
Polish contribution to use a factory method in `AbstractJsonMarshalTester`
rather than additional constructor arguments.

Also change the `JsonContent` tests so that the `Configuration` constructor
is package private. This keeps JsonPath classes out of our public API, at
the expense of limiting custom JsonPath configurations to just our code.

See gh-16629
2019-04-24 19:45:43 -07:00
Phillip Webb 17aaf26590 Use consistent javadoc style for annotation links
Closes gh-13920
2019-04-24 19:37:59 -07:00
Phillip Webb 1e44aba772 Fix compiler warnings and polish
Fix various compiler warnings and apply a little polish.
2019-04-24 19:37:42 -07:00
Diego Berrueta 756a7f12a3 Use Jackson configuration with JsonPath
Update `JacksonTester` so that the JsonPath instance is explicitly configured
with both a `JacksonJsonProvider` and a `JacksonMappingProvider`.

Prior to this commit, the handling of special characters was not symmetrical
between the serialization (handled via the JacksonTester) and the parsing (handled
via JsonPath) due to the fact that JsonPath used `SimpleJson` as its parser.

See gh-16629
2019-04-24 18:15:46 -07:00
Phillip Webb b879972d0d Migrate to MergedAnnotations API
Migrate away from `AnnotationUtils` and `AnnotatedElementUtils`
when possible to the new `MergedAnnotations` API.

Closes gh-16551
2019-04-18 15:40:02 -07:00
Phillip Webb 5f1bbf8c72 Update copyright header of changed files 2019-04-15 17:51:08 -07:00
Phillip Webb 7d4118a0fe Align withBean methods with ApplicationContext
Rework `AbstractApplicationContextRunner.withBean` methods to
align signatures as much as possible with those provided by
the `ApplicationContext`.

Also update the implementation to use a dedicate member
variable rather than adding initializers.

Closes gh-16011
2019-04-15 17:51:08 -07:00
Phillip Webb 2dfd916c96 Polish 2019-04-15 17:51:08 -07:00
Stephane Nicoll a780875390 Allow `ApplicationContextRunner` to accept simple bean definitions
This commit adds `withBean` methods to the `ApplicationContextRunner`
abstraction so that simple beans can be registered inline. This is a
nice alternative for cases where a inner configuration class has to be
defined for the purpose of creating a simple bean.

Closes gh-16011
2019-04-09 12:15:05 +02:00
Stephane Nicoll c432288ed1 Migrate ApplicationContext to common hierarchy
This commit migrates `AnnotationConfigReactiveWebApplicationContext`
parent to the `GenericApplicationContext` abstraction. Any use of
`AnnotationConfigWebApplicationContext` is also removed as it also
inherits from the `AbstractRefreshableApplicationContext` outdated
hierarchy.

A new `AnnotationConfigServletWebApplicationContext` context is
introduced instead, extending from `GenericApplicationContext` and
providing the counter part of the reactive context for the Servlet-based
web app tests.

See gh-16096
2019-04-05 14:17:41 +02:00
Phillip Webb ad7eebee9e Merge branch '2.1.x' 2019-04-03 17:00:25 -07:00
Phillip Webb f12ab1ff90 Update copyright header of changed files 2019-04-03 16:13:00 -07:00
Phillip Webb 2376f973f4 Merge branch '2.1.x' 2019-04-02 13:46:36 -07:00
Phillip Webb 47c6bf741d Merge branch '2.0.x' into 2.1.x 2019-04-02 13:40:21 -07:00
Phillip Webb 07c000c5b7 Merge branch '1.5.x' into 2.0.x 2019-04-02 13:34:28 -07:00
Madhura Bhave 8daa8c48fb Merge branch '2.1.x' 2019-04-01 15:51:25 -07:00
Madhura Bhave c592e71449 Override missing methods in FilteredClassLoader
Closes gh-16404
2019-04-01 15:42:02 -07:00
Andy Wilkinson 878a635bfb Merge branch '2.1.x' 2019-03-28 11:48:47 +00:00
Andy Wilkinson 5a3474c7a8 Polish "Use HTTPS for external links wherever possible"
See gh-16320
2019-03-28 10:53:01 +00:00
Andy Wilkinson 864942ad4f Merge branch '2.0.x' into 2.1.x 2019-03-28 09:35:53 +00:00
Spring Operator 1a4c6f2dac Use HTTPS for external links wherever possible
See gh-16319
2019-03-27 20:06:52 +00:00
Andy Wilkinson ba4671f0ab Merge branch '1.5.x' into 2.0.x 2019-03-27 19:59:36 +00:00
Andy Wilkinson 4900505425 Merge branch '2.0.x' into 2.1.x 2019-03-26 13:53:57 +00:00
Andy Wilkinson fedb40a2bf Merge branch '1.5.x' into 2.0.x 2019-03-26 13:48:32 +00:00
Madhura Bhave 95d10388dd Merge branch '2.1.x' 2019-03-25 11:03:10 -07:00
Madhura Bhave 0c2e71cd08 Prevent early initialization of factory beans in text context customizers
Until Spring Framework 5.1.15, a FactoryBean with a non-default constructor
defined via component scanning would cause an error. This behavior has changed
as of https://github.com/spring-projects/spring-framework/issues/22409.
Regardless of this change we want to ensure that we avoid triggering eager
initialisation. `SimpleFactoryBean` has been written this way so that the tests
fail if early initialization is triggered regardless of the Spring Framework version.

Fixes gh-15898
2019-03-25 10:55:41 -07:00
Andy Wilkinson 36c1c051b8 Merge branch '2.1.x' 2019-03-20 16:55:10 +00:00
Andy Wilkinson e23f72c8b0 Merge branch '2.0.x' into 2.1.x 2019-03-20 16:53:48 +00:00
Andy Wilkinson 9fbd38ab3c Merge branch '1.5.x' into 2.0.x 2019-03-20 16:45:26 +00:00
Spring Operator 00ab30362c Use HTTPS for external links in XML files
See gh-16270
2019-03-20 14:33:25 +00:00
Andy Wilkinson b828b398b5 Merge branch '2.1.x' 2019-03-19 17:11:45 +00:00
Andy Wilkinson a36aa67b52 Merge branch '2.0.x' into 2.1.x 2019-03-19 17:04:41 +00:00
Spring Operator 3e2b6ac8ed Update build and setup configuration to use HTTPS
See gh-16246
2019-03-19 16:58:31 +00:00
Madhura Bhave 0611eb49c8 Merge branch '2.1.x' 2019-03-18 18:03:32 -07:00
Madhura Bhave 7ea8770524 Polish "Fix request factory used with withBasicAuth"
Fixes gh-15982
2019-03-18 18:00:17 -07:00
Dmytro Nosan 756bd890eb Fix request factory used with TestRestTemplate withBasicAuth
This commit updates the behavior of withBasicAuth on TestRestTemplate
by trying to use the same request factory type as the underlying restTemplate.
If creation of a new instance of the configured request factory class fails,
it falls back to the `ClientHttpRequestFactorySupplier`.

See gh-15982
2019-03-18 18:00:08 -07:00
Madhura Bhave 1893eeef4f Merge branch '2.1.x' 2019-03-15 17:27:10 -07:00
Dmytro Nosan 2f3e5d65be Test server port shouldn't affect management port when random
Closes gh-16108
2019-03-15 17:21:29 -07:00
Madhura Bhave 2cdc93cf19 Make TestRestTemplate withBasicAuth fault tolerant
It's part of TestRestTemplate's contract that it's fault tolerant. This
commit aligns the behavior of `withBasicAuth` with that expectation.

Closes gh-15780
2019-03-13 11:49:42 -07:00
Andy Wilkinson 68bfb020aa Reduce need for bean method proxying and disable where not needed
Closes gh-9068
2019-03-12 13:18:42 +00:00
Phillip Webb dd3e8154d9 Merge branch '2.1.x' 2019-03-11 22:15:19 -07:00
Phillip Webb fc3aa43cc2 Update copyright year for changed files 2019-03-11 22:14:53 -07:00
Andy Wilkinson aa2008bc5a Merge branch '2.1.x' 2019-03-11 16:40:19 +00:00
Andy Wilkinson 8c3cec8f13 Merge branch '2.0.x' into 2.1.x 2019-03-11 16:14:19 +00:00
Andy Wilkinson 361437f4e2 Merge branch '1.5.x' into 2.0.x 2019-03-11 15:53:34 +00:00
Stephane Nicoll b34b217d1e Upgrade to Kotlin 1.3.21
Closes gh-16195
2019-03-11 15:56:13 +01:00
Andy Wilkinson d6a869fa98 Switch to Jakarta EE API dependencies where possible
Closes gh-16113
Closes gh-16112
Closes gh-16111
Closes gh-15916
Closes gh-15689
2019-03-06 11:20:51 +00:00
Andy Wilkinson f2e3e274a8 Merge branch '2.1.x' 2019-02-21 08:19:43 +00:00
Andy Wilkinson 53326695ea Polish 2019-02-21 08:13:54 +00:00
Stephane Nicoll 4992b7fb29 Polish "Migrate Kotlin tests to Mockk"
Closes gh-15993
2019-02-19 13:36:06 +01:00
Sebastien Deleuze cca79b8d4d Migrate Kotlin tests to Mockk
See gh-15993
2019-02-19 13:35:43 +01:00
Stephane Nicoll 7413584b00 Polish "Support expressing application `args` in `@SpringBootTest`"
Closes gh-14823
2019-02-13 15:07:11 +01:00
Justin Griffin 422e6b7d41 Support expressing application `args` in `@SpringBootTest`
Add `args` property to the `@SpringBootTest` annotation so tests
can easily supply application arguments to pass to their app under test.

See gh-14823
2019-02-13 14:38:26 +01:00
Andy Wilkinson c04eba7ebc Polish "Add TestNG support in TestTypeExcludeFilter"
See gh-7630
2019-02-12 15:28:19 +00:00
Eddú Meléndez b005008cac Add TestNG support in TestTypeExcludeFilter
See gh-7630
2019-02-12 15:27:51 +00:00
Andy Wilkinson 89bf486d0c Merge branch '2.1.x' 2019-02-05 11:39:37 +00:00
Andy Wilkinson 1f67707509 Fix cast in TestRestTemplateContextCustomizer
Closes gh-15843
2019-02-05 11:39:25 +00:00
Andy Wilkinson 45cc649c7d Merge branch '2.1.x' 2019-02-04 12:36:33 +00:00
Andy Wilkinson 82bc87560c Use AssertJ’s exception assertions rather than fail
Closes gh-15761
2019-02-04 11:48:26 +00:00
Andy Wilkinson 2cb147af7c Merge branch '2.1.x' 2019-01-22 09:22:17 +00:00
Andy Wilkinson e15e140f8c Polish "Fix typos in JsonContentAssert failure messages"
See gh-15752
2019-01-22 09:19:41 +00:00
Johnny Lim 3744082996 Fix typos in JsonContentAssert failure messages
Closes gh-15752
2019-01-22 09:19:25 +00:00
Stephane Nicoll 32b14f3098 Merge branch '2.1.x' 2019-01-17 16:15:32 -05:00
Stephane Nicoll f0a20b1821 Polish contribution
Closes gh-15733
2019-01-17 16:14:15 -05:00
NAIT BELKACEM 6a0053c8bc Fix typo
See gh-15733
2019-01-17 16:11:11 -05:00
Stephane Nicoll 33f2bd4d61 Merge branch '2.1.x' 2019-01-14 08:13:37 -05:00
Stephane Nicoll 485bdc9901 Polish "Remove redundant interface modifiers"
Closes gh-15694
2019-01-14 08:13:08 -05:00
igor-suhorukov 2d873c78fe Remove redundant interface modifiers
See gh-15694
2019-01-14 08:12:41 -05:00
Stephane Nicoll 6baa6b291e Polish contribution
Closes gh-15695
2019-01-14 08:11:20 -05:00
Johnny Lim af3ed9ff9f Polish
See gh-15695
2019-01-14 08:09:32 -05:00
Stephane Nicoll 1e98c78ab9 Fix typo 2018-12-31 09:59:00 +01:00
Camille Vienot ff8edf8d98 Use assertJ to generate AssertionError and filter its stacktrace
Closes gh-15569
2018-12-31 09:58:13 +01:00
Andy Wilkinson 064f6478df Move back to JUnit 4 until SUREFIRE-1614 has been resolved
See gh-14736
See gh-14737
See gh-14738
2018-12-12 16:49:30 +00:00
Stephane Nicoll dfd477aa74 Merge branch '2.1.x' 2018-12-11 08:53:37 +01:00
Stephane Nicoll 38e4d330b0 Merge branch '2.0.x' into 2.1.x 2018-12-11 08:52:58 +01:00
dreis2211 0f92b139f3 Remove Mockito 1 leftover
Closes gh-15422
2018-12-11 08:52:15 +01:00
Madhura Bhave e367b54928 Merge branch '2.1.x' 2018-12-07 11:57:19 -08:00
Madhura Bhave 31a5e85ab6 Perform placeholder resolution in test env post processor
Fixes gh-15354
2018-12-07 11:45:04 -08:00
Andy Wilkinson bbf0932f0f Exclude jcl-over-slf4j in favour of spring-jcl
Closes gh-15392
2018-12-07 15:37:24 +00:00
Stephane Nicoll d5f90ffcfb Polish "Replace this lambda with a method reference"
Closes gh-15401
2018-12-07 11:10:10 +01:00
igor-suhorukov 5c1813aef8 Replace this lambda with a method reference
See gh-15401
2018-12-07 11:01:42 +01:00
Madhura Bhave 5a18df2d69 Fix tests 2018-12-05 18:33:50 -08:00
Madhura Bhave 59d2b0a3fb Upgrade tests to Junit5
See gh-14737
2018-12-05 17:49:09 -08:00
Madhura Bhave 12e1d9a6a4 Add Junit5 OutputCapture Extension
See gh-14738
2018-12-05 17:48:27 -08:00
Johnny Lim fd5aa3ebf1 Polish
See gh-15134
2018-11-11 11:03:13 +01:00
Phillip Webb f3fa20b2d1 Polish 2018-10-29 14:25:45 -07:00
Phillip Webb 683484e4a8 Fix primary beans with ApplicationContextAssert
Update `ApplicationContextAssert.getBean` so that multiple beans are
supported as long as one of them is primary. This aligns better with
the way that the standard `ApplicationContext.getBean` method works.

Closes gh-14874
2018-10-24 21:34:17 -07:00
dreis2211 8b14754cda Remove usages of BasicAuthorizationInterceptor
See gh-14830
2018-10-16 10:21:32 +02:00
Stephane Nicoll 1a0d53dec0 Replace ReflectionTestUtils usage by hasFieldOrPropertyWithValue
Closes gh-14696
2018-10-15 08:25:10 +02:00
Stephane Nicoll baf83aec0d Polish "Allow ClassPathResources to be filtered by FilteredClassLoader"
Closes gh-14774
2018-10-12 15:37:25 +02:00
Roy Jacobs d3ca1a7b0e Allow ClassPathResources to be filtered by FilteredClassLoader
See gh-14774
2018-10-12 15:15:16 +02:00
Andy Wilkinson da7daece08 Tolerate Integer values for port properties
Closes gh-14682
2018-10-04 10:53:02 +01:00
Andy Wilkinson b473f2996d Polish 2018-10-04 10:39:07 +01:00
Phillip Webb d76bba5e6f Migrate from ExpectedException rule to AssertJ
Replace ExpectedException JUnit rules with AssertJ exception
assertions.

Closes gh-14336
2018-10-02 10:55:28 -07:00
Phillip Webb 94b366bc16 Make assertable context interfaces configurable
Update `Assertable*ApplicationContext` interfaces so that they also
extend the appropriate `Configurable*ApplicationContext` interface.

Closes gh-14650
2018-10-01 10:27:39 -07:00
Stephane Nicoll c403ac9db6 Merge branch '2.0.x' 2018-09-26 11:43:59 -04:00
Stephane Nicoll b6e5103dc4 Polish contribution
Closes gh-14592
2018-09-26 11:43:19 -04:00
Marten Deinum 77afe76ed5 Polish
The SpringBootContextLoader still checked if tests were annotated with
@IntegrationTest or @WebIntegrationTest. Those classes have been
removed in Spring Boot 1.5 and been deprecated since 1.4.

This commit removes the check on the annotations as well as the static
list of names.

See gh-14592
2018-09-26 11:41:25 -04:00
Johnny Lim 521f746151 Polish
Closes gh-14517
2018-09-20 09:51:10 +02:00
Madhura Bhave b2dd162572 Merge branch '2.0.x' 2018-09-17 14:30:38 -07:00
Madhura Bhave d7d5cbf959 Simplify printing ConditionEvaluationReport when using context runner
Closes gh-13119
2018-09-17 14:23:47 -07:00
Madhura Bhave d5a197fe66 Support random actuator port in SpringBootTest
This commit changes @SpringBootTest(randomPort = true) to
generate a random port for the actuator endpoints if the
management server runs on a different port from the main
server.

Closes gh-4424
2018-09-14 15:42:08 -07:00
Phillip Webb 04710373bf Add @Author attribution
See gh-11077
2018-09-06 13:42:29 -07:00
Phillip Webb bc357225b5 Polish MockitoPostProcessor
Closes gh-11077
2018-09-06 13:31:35 -07:00
Andreas Neiser a5b3a2646b Test @MockBean/@SpyBean with @Primary
Add additional tests to ensure that `@MockBean` and `@SpyBean`
work consistently when combined with `@Primary`.

See gh-11077
2018-09-06 13:31:33 -07:00
Phillip Webb c777614d8f Support @MockBean/@SpyBean with @Primary
Update `MockitoPostProcessor` so that `@MockBean` and `@SpyBean`
work consistently when combined with `@Primary`.

See gh-11077

Co-authored-by: Andreas Neiser <andreas.neiser@gmail.com>
2018-09-06 13:24:41 -07:00
Phillip Webb 82b27c60a4 Drop MockitoPostProcessor factory method
Remove factory method previously used to create the mock instance.
Since commit 0e00a49dcc, the method is not longer needed.

See gh-11077
2018-09-06 13:22:46 -07:00
Phillip Webb 0e725543d5 Merge branch '2.0.x' 2018-09-05 13:43:16 -07:00
Phillip Webb ec27137632 Merge branch '1.5.x' into 2.0.x 2018-09-05 13:40:48 -07:00
Johnny Lim d92441e53f Update assertion message in AnnotatedClassFinder.scanPackage()
Closes gh-13989
2018-08-03 09:06:38 +02:00
Phillip Webb 4d86ac4713 Polish copyright date on changed files 2018-07-29 09:30:26 +01:00
Phillip Webb 80da9cf5eb Merge branch '2.0.x' 2018-07-29 09:28:56 +01:00
Phillip Webb aeb885192e Polish ternary expressions 2018-07-29 09:24:46 +01:00
Phillip Webb a6c9c92f2e Merge branch '2.0.x' 2018-07-28 01:35:43 +01:00
Phillip Webb 63b609827e Fix checkstyle method order issues
Fix checkstyle issues with method ordering following the
spring-javaformat upgrade.

See gh-13932
2018-07-28 01:11:53 +01:00
Phillip Webb e6a68b39a3 Fix checkstyle javadoc issues
Fix checkstyle issues in javadoc following the spring-javaformat
upgrade.

See gh-13932
2018-07-28 01:11:52 +01:00
Phillip Webb 7fc455654a Fix checkstyle ternary issues
Fix checkstyle issues with ternary expressions following the
spring-javaformat upgrade.

See gh-13932
2018-07-28 01:11:52 +01:00
Stephane Nicoll f780179777 Polish contribution
Closes gh-13904
2018-07-26 17:22:58 +02:00
artsiom df6feb3e2a Make SpringBootConfigurationFinder public and usable with other annotations
See gh-13904
2018-07-26 17:07:55 +02:00
Andy Wilkinson 6a48a440b2 Annotate our test annotations with @ExtendWith(SpringExtension.class)
Closes gh-13739
2018-07-11 17:25:21 +01:00
Andy Wilkinson b4cd4f4c43 Stop mocking class that is final in latest Framework 5.1 snapshots 2018-06-28 10:51:58 +01:00
Andy Wilkinson 20546024d3 Merge branch '2.0.x' 2018-06-20 10:11:44 +01:00
Andy Wilkinson e1774672af Prefer servlet to reactive when Jersey and WebFlux are both available
Closes gh-13521
2018-06-20 10:10:35 +01:00
Brian Clozel bd8106d77f Upgrade to Spring Framework 5.1
As of Spring Framework 5.1, we're depending on the Reactor Californium
release train.
Reactor Netty is now at version 0.8 and changed its artifact
coordinates, package names and broke several APIs. Spring Framework is
now up-to-date with those changes and this commit does the same for
Spring Boot.

Note that in that process, the `NettyServerCustomizer` has been changed
since the former `HttpServerOptions.Builder` API is now gone from
Reactor Netty, and we're now relying on immutable server instances
instead of a stateful builder pattern.

See gh-13321
2018-06-04 18:59:17 +02:00
Andy Wilkinson e306aad28c Merge branch '2.0.x' 2018-06-01 17:27:10 +01:00
Andy Wilkinson 27267a7090 Ensure that condition evaluator uses runner’s class loader
Closes gh-13319
2018-06-01 17:26:32 +01:00
Stephane Nicoll 52b80c77d8 Merge branch '2.0.x' 2018-05-29 10:39:39 +02:00
nkjackzhang 17bcd1c359 Fix wrong reference in cast operation
Closes gh-13288
2018-05-29 10:37:32 +02:00
Stephane Nicoll 7462401291 Merge branch '2.0.x' 2018-05-28 09:28:30 +02:00
Eddú Meléndez 065eebfb4b Fix javadoc
Closes gh-13274
2018-05-28 09:26:16 +02:00
Stephane Nicoll 4464a5f5bd Remove code deprecated in 2.0
Closes gh-12962
2018-05-22 14:48:25 +02:00
Phillip Webb 2dc4f1df00 Polish 2018-05-21 21:32:42 -07:00
Stephane Nicoll 300f6bf4d7 Polish contribution
Closes gh-13208
2018-05-18 14:20:31 +02:00
Mihhail Lapushkin d31dbac69e Support custom UriTemplateHandler in LocalHostUriTemplateHandler
See gh-13208
2018-05-18 14:19:01 +02:00
Phillip Webb 5b3cb8a698 Update copyright header year for changed files 2018-05-04 15:59:26 -07:00
Phillip Webb 6e09e497f2 Formatting 2018-05-04 12:06:19 -07:00
Phillip Webb 2d70a7ae5e Polish caught exception names
Prefer `ex` over `e`.
2018-05-03 22:43:32 -07:00
Phillip Webb 41efea51a7 Polish ternary expressions
Consistently format ternary expressions and always favor `!=` as the
the check.
2018-05-03 22:43:12 -07:00
Phillip Webb e125085993 Merge branch '1.5.x' into 2.0.x 2018-05-03 12:43:50 -07:00
Johnny Lim f03849d502 Polish
See gh-12812
2018-04-10 11:46:16 +02:00
igor-suhorukov 4c61d8abfe avoid check class by string name 2018-03-14 23:59:42 +01:00
Stephane Nicoll ed05e1f7ca Polish "Reorder modifiers to comply with the JLS"
Closes gh-12432
2018-03-12 15:17:23 +01:00
igor-suhorukov aebb475bc5 Reorder modifiers to comply with the JLS
See gh-12432
2018-03-12 15:17:05 +01:00
igor-suhorukov 98f4692c62 Polish
This commit changes invocations to immediately return the expression
instead of assigning it to a temporary variable. The method name should
be sufficient for callers to know exactly what will be returned.

Closes gh-12211
2018-02-25 10:59:02 +01:00
Phillip Webb 4b9c3c137e Polish Collection.toArray
Consistently use `StringUtils.toStringArray`, `ClassUtils.toClassArray`
or zero length when converting collections to arrays.

Fixes gh-12160
2018-02-22 21:11:30 -08:00
Johnny Lim 680287635c Rename TestRestTemplateTestContextCustomizer*
Closes gh-12182
2018-02-22 20:26:14 -08:00
Phillip Webb cd5266ac03 Polish 2018-02-22 20:25:28 -08:00
Johnny Lim 2fe86da95b Use isTrue() and isFalse() for AssertJ
Closes gh-12170
2018-02-22 09:55:40 +01:00
igor-suhorukov fe023817c7 Polish static finals
Closes gh-12083
2018-02-19 20:10:58 -08:00
Johnny Lim 88b184ca23 Polish 2018-02-19 20:00:20 -08:00
Phillip Webb 9e75680e6f Polish 2018-02-16 18:11:54 -08:00
Brian Clozel db7268b841 Fix TestRestTemplate request factory management
This commit fixes two issues in `TestRestTemplate`:

* it improves the detection of the underlying request factory, using
reflection to look inside the intercepting request factory if
interceptors were configured

* it avoids reusing the same request factory when creating a new
`TestRestTemplate` with `withBasicAuth`. Sharing the same instance would
result in sharing authentication state (HTTP cookies). Since the
original request factory can't be detected consistently, a new one is
selected automatically

See gh-8697
2018-02-16 22:36:20 +01:00
Brian Clozel 03a6f97e76 TestRestTemplate should not override request factory
Previously `TestRestTemplate` would override the configured
`ClientHttpRequestFactory` if the Apache HTTP client library was on
classpath.

This commit fixes two issues:

1. The existing `ClientHttpRequestFactory` is overridden *only* if it is
using the Apache HTTP client variant, in order to wrap it with the
`TestRestTemplate` custom support

2. Calling `withBasicAuth` will no longer directly use the request
factory returned by the internal `RestTemplate`; if client interceptors
are configured, the request factory is wrapped with an
`InterceptingClientHttpRequestFactory`. If we don't unwrap it,
interceptors are copied/applied twice in the newly created
`TestRestTemplate` instance. For that, we need to use reflection as the
underlying request factory is not accessible directly.

Closes gh-8697
2018-02-16 12:29:47 +01:00
Phillip Webb 728b522307 Include scope support on ApplicationContextAssert
Update `ApplicationContextAssert` with support for scopes. Allows
tests to consider the all ancestors, or limit assertions to just the
current context.

Fixes gh-12015
2018-02-12 17:49:54 -08:00
Phillip Webb 7ab587a067 Add initializer support
Add `ApplicationContextInitializer` support to
`ApplicationContextRunner`.
2018-02-12 17:49:53 -08:00
Phillip Webb 0348889fd7 Polish 2018-02-12 10:03:06 -08:00
Brian Clozel 2be0c46562 Remove TestRestTemplate constructors taking template args
As discussed in gh-11872, `TestRestTemplate` constructor variants taking
a `RestTemplate` argument are confusing since the main goal of that
class is to mutate `RestTemplate`.

This commit removes all those constructor variants and replaces them
with `RestTemplateBuilder` arguments when possible.

Closes gh-11872
2018-02-12 16:57:15 +01:00
Andy Wilkinson 76a450dfba Format with Eclipse Oxygen SR2 2018-02-08 10:53:53 +00:00
Andy Wilkinson 37f3b1d1e5 Polish 2018-02-08 10:10:34 +00:00
Andy Wilkinson b3ed46af5a Polish 2018-02-07 16:30:03 +00:00
Phillip Webb 7ea6af0e46 Make AbstractApplicationContextRunner public
Fixes gh-11929
2018-02-06 13:28:18 -08:00
Andy Wilkinson 886f782b20 Merge branch '1.5.x' 2018-02-05 11:04:48 +00:00
Phillip Webb 69234f8c08 Polish 2018-02-02 18:59:05 -08:00
Andy Wilkinson 875091ed85 Polish “Remove or use unused method parameters”
Closes gh-11812
2018-02-02 09:34:19 +00:00
igor-suhorukov 717bd2c580 Remove or use unused method parameters 2018-02-02 09:34:19 +00:00
Phillip Webb 706aa7af59 Make getInitializers() a protected method
Update `SpringBootContextLoader` so that `getInitializers()` is now a
protected method for subclasses to override if necessary.

Closes gh-11457
2018-02-01 12:24:11 -08:00
Andy Wilkinson 458dde63a8 Explicitly order AbstractTestExecutionListener subclasses
By default, AbstractTestExecutionListeners have an order of lowest
precedence. This means that it is impossible to write a listener with
lower precedence that any listener that's using the default order.

This commit updates Boot's 6 AbstractTestExecutionListeners to order
them explicitly. MockitoTestExecutionListener performs injection of
Mockito mocks and spies into the test instance. It now has an order of
2050 giving it slightly lower precedence than the dependency injection
test execution listener (2000).

The remaining 5 listeners have all been ordered with lowest precedence
- 100. This leaves them near their current lowest precedence position
while creating some room for any listeners that require lower
precedence.

Closes gh-11796
2018-02-01 14:28:25 +00:00
dreis2211 a7663c88d3 Replace casted Mockito.any() calls
Closes gh-11817
2018-01-29 07:50:29 +01:00
Jon Schneider fd237f85cc Extract common micrometer test setup
Create `MetricsRun` that can be used to apply common micrometer test
configuration to a `ApplicationContextRunner`.

Closes gh-11804
2018-01-26 14:42:22 -08:00
Phillip Webb b7c52da457 Allow custom WebTestClient beans
Update `@SpringBootTest` `WebTestClient` support so that the bean
definition is only registered when the user has not defined or
auto-configured their own.

See gh-10556
2018-01-25 00:08:19 -08:00
Phillip Webb 177281a504 Allow custom TestRestTemplate beans
Update `@SpringBootTest` `TestRestTemplate` support so that the bean
definition is only registered when the user has not defined or
auto-configured their own.

See gh-10556
2018-01-25 00:08:19 -08:00
Phillip Webb ab6ad6aa4b Polish 2018-01-24 16:09:14 -08:00
andrey.onufreyko b19dcb13e2 Replace string arguments with char
Optimize method calls by replacing single character String arguments
with char.

Closes gh-11680
2018-01-22 16:35:06 -08:00
Stephane Nicoll c926bed6f5 Polish "Fix modifiers order"
Closes gh-11681
2018-01-19 11:30:30 +01:00
igor-suhorukov e2d05607f2 Fix modifiers order
See gh-11681
2018-01-19 11:30:06 +01:00
Phillip Webb f3379668ac Polish 2018-01-18 23:21:51 -08:00
Phillip Webb 6d93573db0 Merge branch '1.5.x' 2018-01-18 22:03:51 -08:00
Stephane Nicoll efd941bbe0 Merge branch '1.5.x' 2018-01-18 17:05:22 +01:00
Andy Wilkinson 54c0cf513b Polish 2018-01-17 19:03:23 +00:00
sdeleuze d4c91d2fe0 Improve Kotlin extensions doc about type erasure
Since type erasure can be fixed only when using
ParameterizedTypeReference based Java methods, TestRestTemplate
API documentation should be updated to specify which extensions
are subject to type erasure, and which are not.

Closes gh-11604
2018-01-16 10:19:12 +01:00
Andy Wilkinson db83a80deb Correct test expectations following changes to application context ID
See gh-11023
2018-01-10 14:12:06 +00:00
Phillip Webb b078698f20 Update copyright year of changed files 2018-01-09 12:13:27 -08:00
Johnny Lim b8706c47d6 Use instance equality for Class
Closes gh-11534
2018-01-09 09:30:36 +01:00
Andy Wilkinson 268b97bf98 No-op ResetMocksTestExecutionListener when Mockito is not present
Closes gh-11508
2018-01-05 11:13:36 +00:00
Stephane Nicoll ac004eabf3 Update copyright header
See gh-11510
2018-01-05 10:30:43 +01:00
Johnny Lim 37d8eedae3 Polish
Closes gh-11510
2018-01-05 10:29:22 +01:00
Phillip Webb bee5fa7fc6 Polish 2018-01-03 13:24:04 -08:00
Madhura Bhave 8102dc78cb Remove redundant throws declarations 2017-12-29 12:10:13 -08:00
Johnny Lim 8f7ab95e0e Use BufferedReader.lines()
Closes gh-11436
2017-12-27 16:44:27 +01:00
Johnny Lim e4f0ad2165 Polish
Closes gh-11372
2017-12-23 13:11:53 +01:00
Phillip Webb 2efa21c570 Make hot methods in-line friendly
Refactor a few hot methods so that they are more likely to be in-lined
by the JIT.

Fixes gh-11409
2017-12-22 20:55:47 -08:00
dreis2211 00d12c5b2d Align 'behavior' spelling to style guide
Closes gh-11394
2017-12-22 18:15:19 +01:00
Phillip Webb 3273859fde Polish 2017-12-13 14:32:55 -08:00
Phillip Webb 5ca608330c Merge branch '1.5.x' 2017-12-13 13:07:18 -08:00
Stephane Nicoll a626f5462d Consistent use of @AliasFor
Closes gh-10836
2017-12-13 14:42:16 +01:00
Stephane Nicoll 7f2af8b209 Polish 2017-12-13 09:46:41 +01:00
Stephane Nicoll 23218add90 Polish 2017-12-12 11:57:30 +01:00
Johnny Lim 96250743b5 Add missing "abstract" keywords
Closes gh-11303
2017-12-09 15:29:15 -08:00
Johnny Lim 6d54072e04 Remove "final" keywords
Closes gh-11294
2017-12-08 11:13:07 -08:00
Stephane Nicoll 7380920ed4 Remove wrong usage of commons-lang3
Closes gh-11267
2017-12-05 17:43:56 -08:00
Johnny Lim 2c204f2154 Polish
Closes gh-11242
2017-12-02 09:03:59 +01:00
Andy Wilkinson 03fce55cdb Polish "Remove a redundant dash in TestPropertyValues.Type"
Closes gh-11156
2017-11-27 10:44:53 +00:00
Johnny Lim f21737a675 Remove a redundant dash in TestPropertyValues.Type
Prior to this change, the dash was duplicated. For example
"test--systemEnvironment". This commit removes the redundant dash
and corrects the assertion in the test that should have caught the
problem.

See gh-11156
2017-11-27 10:43:38 +00:00
Stephane Nicoll aa87c45b5d Polish "Introduce TestRestTemplate Kotlin extensions"
Closes gh-11039
2017-11-24 09:56:47 +01:00
sdeleuze cd98da5ee9 Introduce TestRestTemplate Kotlin extensions
This commit introduces Kotlin extensions similar to the RestOperations
ones in order to be able to take advantage of Kotlin reified type
parameters for example.

See gh-11039
2017-11-24 09:44:34 +01:00
Phillip Webb e147982045 Add FilteredClassLoader
Add `FilteredClassLoader` to replace `HideClassesClassLoader` and
`HidePackagesClassLoader`.

Fixes gh-10303
2017-11-18 23:20:00 -08:00
Johnny Lim cbb483735d Polish
Closes gh-10948
2017-11-16 10:36:20 +01:00
Andy Wilkinson 71632ac767 Polish "Provide access to root URI from TestRestTemplate"
See gh-10641
2017-11-12 12:11:57 +00:00
tinexw c1205c3243 Provide access to root URI from TestRestTemplate
Closes gh-10641
2017-11-12 12:05:53 +00:00
Andy Wilkinson 07462be090 Polish 2017-11-11 16:29:12 +00:00
Johnny Lim bd0dcfb172 Utilize StandardCharsets
Closes gh-10972
2017-11-10 09:49:13 +01:00