Commit Graph

275 Commits

Author SHA1 Message Date
Raja Kolli a4a0eef186 Upgrade to Hibernate Validator 6.0.2.Final
Closes gh-9969
2017-09-19 17:40:45 +02:00
Phillip Webb 2e51b48cd9 Refactor actuator package locations
Restructure actuator packages to improve structure. The following
changes have been made:

 - Separate actuator and actuator auto-configuration into different
   modules.
 - Move endpoint code into `spring-boot-actuator`.
 - Move `Endpoint` implementations from a single package into
   technology specific packages.
 - Move `HealthIndicator` implementations from a single package into
   technology specific packages.
 - As much as possible attempt to mirror the `spring-boot` package
   structure and class naming in `spring-boot-actuator` and
   `spring-boot-actuator-autoconfigure`.
 - Move `DataSourceBuilder` and DataSource meta-data support from
   `spring-boot-actuator` to `spring-boot`.

Fixes gh-10261
2017-09-12 00:11:20 -07:00
Phillip Webb 2c97d3a5e9 Polish 2017-08-29 15:59:32 -07:00
Johnny Lim 118f65556f Remove unused ExpectedExceptions
Closes gh-10101
2017-08-29 13:19:04 +02:00
Madhura Bhave e08ddbf838 Rework security autoconfiguration
This commit combines security autoconfigurations for
management endpoints and the rest of the application. By default,
if Spring Security is on the classpath, it turns on @EnableWebSecurity.
In the presence of another WebSecurityConfigurerAdapter this backs off
completely. A default AuthenticationManager is also provided with a user
and generated password. This can be turned off by specifying a bean of
type AuthenticationManager, AuthenticationProvider or UserDetailsService.

Closes gh-7958
2017-08-27 23:15:18 -07:00
Johnny Lim 14c9f91aab Polish
Closes gh-10054
2017-08-22 16:28:03 +02:00
Stephane Nicoll 394371eb73 Polish "Harmonize database initializers"
Closes gh-9752
2017-08-18 18:14:22 +02:00
Andy Wilkinson 66f9696a44 Merge branch '1.5.x' 2017-08-09 11:46:53 +01:00
Andy Wilkinson 7967c64d65 Avoid NPE in AnnotationsPropertySource if getAnnotations returns null
Closes gh-9914
2017-08-09 11:42:38 +01:00
Andy Wilkinson 25d0cc167e Polish "Avoid NPE in PropertyMappingContextCustomizer"
See gh-9914
2017-08-09 11:41:39 +01:00
Dennis Kieselhorst e7a6b8c260 Avoid NPE in PropertyMappingContextCustomizer
See gh-9914
2017-08-09 11:40:41 +01:00
Phillip Webb 9127c48fb5 Fixup warnings 2017-07-27 16:39:49 -07:00
Spring Buildmaster 17a5bb0be4 Next development version 2017-07-27 08:00:21 +00:00
Phillip Webb 89ad0660d1 Make ApplicationContextRunner immutable
Update `ApplicationContextRunner` so that it is totally immutable.
Methods now return new instances rather than changing existing state.

See gh-9875
2017-07-26 17:50:34 -07:00
Phillip Webb 07556cda51 Restructure `boot.test.context` package
Split up `org.springframework.boot.test.context` into distinct packages
for `runner` and `assertj`.

See gh-9875
2017-07-26 17:47:59 -07:00
Phillip Webb 497457c397 Rename ApplicationContextTester -> Runner
Rename `ApplicationContextTester` and related classes to
`ApplicationContextRunner` and refactor existing tests to use correctly
named variables.

See gh-9875
2017-07-26 17:46:06 -07:00
Spring Buildmaster 41c5c0e7c9 Next development version 2017-07-26 08:30:55 +00:00
Stephane Nicoll 996e6bf48c Reset Neo4j tests to use the default driver again
This commit resets the artificial use of the http driver now the bolt
driver doesn't check if the connection to the Neo4J server is valid
on startup.

See neo4j/neo4j-java-driver#380

Closes gh-9500
2017-07-26 10:06:36 +02:00
Emanuel Campolo 2626a3a795 Use lambdas when possible
Replace anonymous inner classes with lambda declarations (when possible
using method references).

See gh-9781
2017-07-25 00:53:38 -07:00
Emanuel Campolo 04fdec6f8b Replace explicit generics with diamond operator
Where possible, explicit generic declarations to use the Java 8 diamond
operator.

See gh-9781
2017-07-25 00:53:37 -07:00
Phillip Webb 7b2b8dc4a3 Merge branch '1.5.x' 2017-07-24 13:02:12 -07:00
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
2017-07-24 12:54:24 -07:00
Andy Wilkinson dff9fb12aa Merge branch '1.5.x' 2017-07-24 11:38:40 +01:00
Andy Wilkinson b7080ddec5 Polish "Ensure SpringBootDITEL fails with the original failure" 2017-07-24 11:37:40 +01:00
Danny Thomas 2c48087604 Ensure SpringBootDITEL fails with the original failure
See gh-9534
2017-07-24 11:23:16 +01:00
Phillip Webb e1ef2a591f Fixup tests to use new ApplicationContextTester
Update existing tests that previously use `ContextLoader` to the newly
introduced `*ApplicationContextTester` classes.

See gh-9634
2017-07-19 12:40:53 -07:00
Phillip Webb 8e3baf3130 Polish 2017-07-11 13:57:21 -07:00
Stephane Nicoll cb13c98649 Polish 2017-07-08 15:36:18 +02:00
Stephane Nicoll ef5c2afcc9 Polish 2017-07-07 11:11:16 +01:00
Andy Wilkinson dd0ce54425 Improve the type-safety of ContextLoader for servlet and reactive web 2017-07-07 11:11:16 +01:00
Andy Wilkinson 19ddfad63e Migrate some more tests to the new ContextLoader 2017-07-07 11:11:16 +01:00
Phillip Webb eb17aa06f9 Merge branch '1.5.x' 2017-07-06 18:38:52 -07:00
Phillip Webb aa57ca7e18 Polish 2017-07-06 16:53:04 -07:00
Brian Clozel f2e77e46cd Auto-configure codecs in WebTestClient
This commit applies what's been done in gh-9166 for WebFlux client and
server, but for the `WebTestClient` auto-configuration.

`WebTestClient` can be configured for mock or integration tests and this
change applies `CodecCustomizer` beans to the client being built.

Closes gh-9577
2017-07-03 11:23:06 +02:00
Brian Clozel 64777204d8 Apply codecs auto-configuration to WebFlux
This commit introduces `CodecCustomizer`, a new callback-based interface
for customizing the codecs configuration for WebFlux server and client.

Instances of those customizers are applied to the `WebClient.Builder`
and to the `WebFluxAutoConfiguration` (which deals with both WebFlux and
WebFlux.fn).

For now, only Jackson codecs are auto-configured, by getting the
`ObjectMapper` instance created by Spring Boot. Other codecs can be
configured as soon as WebFlux supports those.

Closes gh-9166
2017-07-03 11:23:06 +02:00
Brian Clozel 4ce726b1a0 Auto-configure WebClient.Builder
This commit adds a new customizer interface for applying
configuration changes to `WebClient.Builder` beans:
`WebClientCustomizer`.

The new WebClient auto-configuration will make available, as a
prototype scoped bean, `WebClient.Builder` instances.
Once injected, developers can use those to create `WebClient`
instances to be used in their application.

`WebClientCustomizer` beans are sorted according to their
`Order` and then applied to the builder instances.

Closes gh-9522
2017-07-03 11:23:06 +02:00
Andy Wilkinson dc020ffa6c Merge branch '1.5.x' 2017-06-23 16:59:35 -07:00
Andy Wilkinson 99d53a5980 Polish 2017-06-23 16:59:24 -07:00
Andy Wilkinson 43319a4484 Merge branch '1.5.x' 2017-06-23 14:48:05 -07:00
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
2017-06-23 14:44:08 -07:00
Andy Wilkinson 991314c63d Merge branch '1.5.x' 2017-06-16 09:13:42 +01:00
Andy Wilkinson 59122358d3 Clean up and format code 2017-06-16 08:58:14 +01:00
Stephane Nicoll dbabfc224c Add support for Lettuce in RedisTestServer
Previously, RedisTestServer only supported Jedis and would blow up if
only Lettuce was on the classpath. This commit defensively checks which
driver is available and chose the appropriate one, defaulting to Jedis.

Closes gh-9524
2017-06-15 14:42:24 +02:00
Stephane Nicoll dd53ed0aec Polish "Add Slice test annotation for Redis"
Closes gh-9224
2017-06-15 11:38:32 +02:00
Jayaram Pradhan 2d36d2a7e4 Add Slice test annotation for Redis
This commit adds new annotation `@DataRedisTest` which provides test
infrastructure for redis.

See gh-9224
2017-06-15 11:12:13 +02:00
Stephane Nicoll c5d44cdae4 Fix build failure
More change to use the http Neo4j driver

See https://github.com/neo4j/neo4j-java-driver/issues/380

Closes gh-9499
2017-06-13 14:37:37 +02:00
Phillip Webb b94bb00fa1 Remove need for attached test-jar artifacts
Remove test-jar artifacts from Maven projects and relocate classes. The
majority of utilities now live in the `spring-boot-testsupport` module.

This update will help us to deploy artifacts using the standard Maven
deploy plugin in the future (which doesn't support the filtering of
individual artifacts).

Fixes gh-9493
2017-06-12 21:11:35 -07:00
Spring Buildmaster 05d4d0281c Next Development Version 2017-06-08 12:47:16 +00:00
Phillip Webb 2c7dd9f519 Polish 2017-06-02 16:00:39 -07:00
Stephane Nicoll d096dcad1d Polish "Add @JooqTest"
Closes gh-9343
2017-05-31 15:10:09 +02:00