226 Commits

Author SHA1 Message Date
Stephane Nicoll
f41801ee8c Narrow down ConditionalOnWebApplication
Use the new `type` attribute of `@ConditionalOnWebApplication` for the
configurations that have a hard dependency on the Servlet/MVC API.

See gh-8118
2017-02-07 15:53:18 +01:00
Stephane Nicoll
6af6e8e31b Remove auto-configuration for ServerProperties
This commit removes `ServerProperties` and `ManagementServerProperties`
auto-configurations. Those properties objects are now created using
`@EnableConfigurationProperties` only.

Closes gh-8108
2017-02-06 14:00:50 +01:00
Stephane Nicoll
cfdc75d384 Merge branch '1.5.x' 2017-02-06 10:38:16 +01:00
Johnny Lim
0adab8a2be Use logical 'and' instead of bitwise 'and'
Closes gh-8198
2017-02-06 10:35:13 +01:00
Stephane Nicoll
5c663a9ece Merge branch '1.5.x' 2017-02-01 09:08:33 +01:00
Johnny Lim
846994e498 Polish
Closes gh-8148
2017-02-01 09:07:47 +01:00
Brian Clozel
1709a3ad96 Adapt to Assert.instanceOf changes
Since SPR-15196, the behavior of `Assert` methods changed and some were
deprecated. This commit adapts to the new error mechanism implemented in
`Assert.instanceOf`.

Fixes gh-8140
2017-01-31 11:42:20 +01:00
Andy Wilkinson
95f659f4f9 Add new WebApplicationType enum to pave the way for Web Flux support
Closes gh-8077
2017-01-30 20:26:24 +00:00
Spring Buildmaster
5c12500366 Next Development Version 2017-01-30 20:10:13 +00:00
Spring Buildmaster
a2696bf873 Next Development Version 2017-01-30 11:40:24 +00:00
Phillip Webb
8747e039ee Merge branch '1.5.x' 2017-01-27 17:50:01 -08:00
Phillip Webb
fa6a138598 Refine ImportsContextCustomizer cache logic
Update `ImportsContextCustomizer` so that whenever possible a more
specific cache key is used.

Prior to this commit the customizer would generate a key based on *all*
annotations on the test class. This has repeatedly caused issues where
test classes that should have the same cache key did not due to
unrelated annotations.

A new `DeterminableImports` interface has been added that can be
implemented by `ImportSelector` and `ImportBeanDefinitionRegistrar`
implementations that are able to determine their imports early. The
existing `ImportAutoConfigurationImportSelector` and
`AutoConfigurationPackages` classes have been retrofitted with
this interface.

Fixes gh-7953
2017-01-27 17:19:52 -08:00
Phillip Webb
aaf118c544 Fix TypeExcludeFiltersContextCustomer key
Update `TypeExcludeFiltersContextCustomer` to use filter instances
as part of the key, rather than class references. In order to be used
in tests, `TypeExcludeFilter` implementations must now implement valid
`hashCode` and `equals` methods.

Fixes gh-8125
2017-01-27 17:18:58 -08:00
Eddú Meléndez
3d52c86a21 Annotate interfaces with @FunctionaInterface
Closes gh-6857
2017-01-27 16:41:01 +00:00
Spring Buildmaster
ed1ce140c0 Next Development Version 2017-01-26 14:20:39 +00:00
Phillip Webb
8ffaa54e74 Merge branch '1.5.x' 2017-01-23 23:45:44 -08:00
Phillip Webb
2c89d9918f Relocate AutoConfigurations from root package
Move PropertyPlaceholder and MessageSource auto-configuration from the
root package to the `context` subpackage.

Fixes gh-8071
2017-01-23 17:32:45 -08:00
Phillip Webb
3893383cbe Merge branch '1.5.x' 2017-01-23 16:40:30 -08:00
Phillip Webb
5703fb1515 Polish 2017-01-23 16:03:59 -08:00
Stephane Nicoll
4fe04178b7 Merge branch '1.5.x' 2017-01-20 16:43:21 +01:00
Stephane Nicoll
915c959a28 Polish contribution
Closes gh-7600
2017-01-20 16:40:48 +01:00
Michael J. Simons
8648520876 Add slide test annotation for MongoDB
This commits adds a slice test infrastructure for MongoDB, similar to
what `@DataJpaTest` does with JPA.

By default, an embedded Mongod process is used if available.

See gh-7600
2017-01-20 16:40:47 +01:00
Phillip Webb
89f7ec054f Merge branch '1.5.x' 2017-01-19 12:45:26 -08:00
Phillip Webb
f3cd0ad22c Polish 2017-01-19 12:44:57 -08:00
Phillip Webb
655fa59db0 Merge branch '1.4.x' into 1.5.x 2017-01-19 12:33:42 -08:00
Phillip Webb
b05bdbfe4f Polish 2017-01-19 12:31:43 -08:00
Stephane Nicoll
03afa0b7b9 Merge branch '1.5.x' 2017-01-19 16:36:21 +01:00
Stephane Nicoll
e44b595c0d Fix merge issue 2017-01-19 16:36:00 +01:00
Stephane Nicoll
b29e296383 Merge branch '1.5.x' 2017-01-19 16:15:03 +01:00
Stephane Nicoll
d2299555d2 Merge branch '1.4.x' into 1.5.x 2017-01-19 16:14:44 +01:00
Stephane Nicoll
ffa6d6d6e0 Improve error message used in TestDatabaseAutoConfiguration
By default, `@DataJpaTest` (and `@AutoConfigureTestDatabase`) attempt to
replace any existing `DataSource` by an embedded one. Previously, if
there is was no embedded database on the classpath, the exception message
did not provide that context in the error message.

This commit clarifies the error message to conduct
`TestDatabaseAutoConfiguration` (that is replacing the existing
`DataSource`).

Closes gh-7797
2017-01-19 16:13:49 +01:00
Phillip Webb
5502fa2936 Merge branch '1.5.x' 2017-01-18 21:05:22 -08:00
Phillip Webb
0a6456a748 Always use prefix config annotation attribute
Update use of `@ConfigurationProperties` to prefer the more explicit
`prefix` attribute, rather than `value`.

See gh-7579
2017-01-18 20:49:53 -08:00
Stephane Nicoll
dbb9a1bd20 Merge branch '1.5.x' 2017-01-06 10:13:20 +01:00
Stephane Nicoll
7a75fb0f38 Fix test-specific configuration metadata
Most of the config keys defined by the `spring-boot-test-autoconfigure`
module can't be overridden because they are mapped with `@PropertyMapping`
on an annotation. It is confusing that such keys are exposed in content
assistance as using them will have no effect.

This commit removes the annotation processor from the build so that the
`@ConfigurationProperties` beans aren't processed anymore. Instead, manual
metadata is written for the two only keys that are effectively used in
regular configuration.

As a result, the `additional-spring-configuration-metadata` file has been
renamed to `spring-configuration-metadata` since nothing is processing it
anymore.

Closes gh-7887
2017-01-06 10:12:57 +01:00
Phillip Webb
125d9d6181 Merge branch '1.5.x' 2017-01-04 20:04:09 -08:00
Phillip Webb
e015e13b4d Include ErrorAttributes in @WebMvcTest
Import the additional auto-configuration classes required for
`ErrorAttributes` and change the filter so that it's no longer
hidden.

Fixes gh-7867
2017-01-04 15:25:33 -08:00
Stephane Nicoll
506f6497c0 Merge branch '1.5.x' 2017-01-04 09:56:19 +01:00
Johnny Lim
f915ae197a Polish 2017-01-04 09:53:45 +01:00
Phillip Webb
86a42e4e44 Merge branch '1.5.x' 2016-12-30 00:32:00 -08:00
Phillip Webb
54aeff47a2 Add exclude support to @ImportAutoConfiguration
Update `@ImportAutoConfiguration` with support for an exclude attribute
that works in a similar way to `@EnableAutoConfiguration`.

Also update existing `@Test...` annotation with exclude attribute
aliases.

Fixes gh-6809
2016-12-30 00:31:30 -08:00
Phillip Webb
8b69856fc9 Polish 2016-12-28 15:23:26 -08:00
Spring Buildmaster
9057f9ae1f Next development version 2016-12-23 00:15:23 +00:00
Phillip Webb
1f417997f3 Merge branch '1.5.x' 2016-12-19 13:21:18 -08:00
Phillip Webb
6121208cbb Polish formatting 2016-12-19 12:47:03 -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
e3496614be Merge branch '1.5.x' 2016-12-16 10:53:53 +01:00
Stephane Nicoll
21b815aabd Polish contribution
Closes gh-7560
2016-12-16 10:52:43 +01:00
Eddú Meléndez
5a7624df7c Add support for property spring.test.database.replace
Closes gh-7229
2016-12-16 09:40:55 +01:00