Commit Graph

163 Commits (29c84dff4ade7d92e25adb11977877d24a9a4b7c)

Author SHA1 Message Date
Spring Buildmaster 30eb937a83 Next Development Version 7 years ago
Andy Wilkinson 7967c64d65 Avoid NPE in AnnotationsPropertySource if getAnnotations returns null
Closes gh-9914
7 years ago
Andy Wilkinson 25d0cc167e Polish "Avoid NPE in PropertyMappingContextCustomizer"
See gh-9914
7 years ago
Dennis Kieselhorst e7a6b8c260 Avoid NPE in PropertyMappingContextCustomizer
See gh-9914
7 years ago
Spring Buildmaster 17a5bb0be4 Next development version 7 years ago
Spring Buildmaster 41c5c0e7c9 Next development version 7 years ago
Phillip Webb b9cfe21193 Make @ImportAutoConfiguration not register package
Update `@ImportAutoConfiguration` so that it is no longer annotated with
`@AutoConfigurationPackage` and as such isn't a marker for
`AutoConfigurationPackages`.

Having `@ImportAutoConfiguration` marked as an auto-configuration
package is particularly problematic in tests since it frequently breaks
context caching.

Fixes gh-9282
7 years ago
Andy Wilkinson b7080ddec5 Polish "Ensure SpringBootDITEL fails with the original failure" 7 years ago
Danny Thomas 2c48087604 Ensure SpringBootDITEL fails with the original failure
See gh-9534
7 years ago
Phillip Webb aa57ca7e18 Polish 7 years ago
Andy Wilkinson 99d53a5980 Polish 8 years ago
Andy Wilkinson 0aa0fd0670 Ensure that Jackson and GSON are auto-configured by @AutoConfigureJsonTesters
Previously, @AutoConfigureJsonTesters only imported
JsonTestersAutoConfiguration and relied on something else pulling in
the Jackson and GSON auto-configuration upon which it depends. This
worked with @JsonTest which imported those auto-configurations. It
did not work with @SpringBootTest which would use
@EnableAutoConfiguration and the ordering was then wrong and
JsonTestersAutoConfiguration would be processed before the Jackson
and GSON auto-configurations had a chance to create the beans that
JsonTestersAutoConfiguration needs.

This commit updates the spring.factories configuration for
JsonTestersAutoConfiguration so that it imports
JacksonAutoConfiguration and GsonAutoConfiguration.
Appropriate @AutoConfigureAfter has also been added to
JsonTestersAutoConfiguration to ensure that it is considered after
JacksonAutoConfiguration and GsonAutoConfiguration.

Lastly, ExampleJsonApplication and associated classes have been moved
into an app sub-package to prevent its component scanning from
pulling in JsonTestersAutoConfiguration as if it were user
configuration.

Closes gh-9515
8 years ago
Andy Wilkinson 59122358d3 Clean up and format code 8 years ago
Spring Buildmaster 05d4d0281c Next Development Version 8 years ago
Spring Buildmaster 9768b0a8c2 Next Development Version 8 years ago
Phillip Webb 8eb79b3c0f Polish 8 years ago
Phillip Webb f46d799f31 Polish 8 years ago
Madhura Bhave 9e2d54feae Support json view with JacksonTester
Closes gh-8672
8 years ago
Stephane Nicoll 934d33685a Polish
See gh-8879
8 years ago
Phillip Webb ad38776de3 Polish 8 years ago
Madhura Bhave f73714bdcc Do not filter HttpMessageConverters in WebMvcTest
Closes gh-8617
8 years ago
Spring Buildmaster d23fa24340 Next Development Version 8 years ago
Phillip Webb ca1540cefe Update header copyright for changed files 8 years ago
Andy Wilkinson 98a2ae3b91 Merge branch '1.4.x' into 1.5.x 8 years ago
Andy Wilkinson 1abd91dc23 Start building against Spring Framework 4.3.7 snapshots
See gh-8248
8 years ago
Johnny Lim 0adab8a2be Use logical 'and' instead of bitwise 'and'
Closes gh-8198
8 years ago
Johnny Lim 846994e498 Polish
Closes gh-8148
8 years ago
Spring Buildmaster 5c12500366 Next Development Version 8 years ago
Spring Buildmaster a2696bf873 Next Development Version 8 years ago
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
8 years ago
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
8 years ago
Spring Buildmaster ed1ce140c0 Next Development Version 8 years ago
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
8 years ago
Phillip Webb 5703fb1515 Polish 8 years ago
Stephane Nicoll 915c959a28 Polish contribution
Closes gh-7600
8 years ago
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
8 years ago
Phillip Webb f3cd0ad22c Polish 8 years ago
Phillip Webb 655fa59db0 Merge branch '1.4.x' into 1.5.x 8 years ago
Phillip Webb b05bdbfe4f Polish 8 years ago
Stephane Nicoll e44b595c0d Fix merge issue 8 years ago
Stephane Nicoll d2299555d2 Merge branch '1.4.x' into 1.5.x 8 years ago
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
8 years ago
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
8 years ago
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
8 years ago
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
8 years ago
Johnny Lim f915ae197a Polish 8 years ago
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
8 years ago
Phillip Webb 8b69856fc9 Polish 8 years ago
Spring Buildmaster 9057f9ae1f Next development version 8 years ago
Phillip Webb 6121208cbb Polish formatting 8 years ago