Commit Graph

2945 Commits

Author SHA1 Message Date
Johnny Lim 360e3a492c Polish
closes gh-9729
2017-07-12 13:25:19 +02: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 fa71051ec6 Polish "Upgrade to Infinispan 9.0.3.Final"
Closes gh-9688
2017-07-08 15:30:13 +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
Andy Wilkinson b11053afc4 Align with breaking API changes in Spring Data MongoDB 2017-07-04 17:31:07 +01: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
Stephane Nicoll 18ba414000 Add test helper to manipulate the ApplicationContext
This commit adds ContextLoader, a test helper that configures an
ApplicationContext that is meant to simulate a particular
auto-configuration scenario.

The auto-configuration, user configuration and environment can be
customized. The loader invokes a ContextConsumer to assert the context
and automatically close the context once it is done.

Concretely, tests can create a shared field instance of that helper with
the shared configuration to increase its visibility and tune the context
further in each test.

If the context is expected to fail, `loadAndFail` allows to optionally
assert the root exception and consume it for further assertions.

This commit also migrates some tests to illustrate the practical use of
the helper

Closes gh-9634
2017-06-29 15:34:10 +02:00
Stephane Nicoll 2892039ccd Better tests for datasource initialization
See gh-9528
2017-06-28 10:48:47 +02:00
Stephane Nicoll 4e19c47e78 Fix wrong assertion 2017-06-28 10:31:14 +02:00
Stephane Nicoll 1ba0df99b2 Polish 2017-06-28 09:40:31 +02:00
Stephane Nicoll 557361c9e0 Properly set redis password for Cluster and Sentinel config
Closes gh-9583
2017-06-27 15:47:07 +02:00
Stephane Nicoll 1a839d6656 Remove useless cluster check 2017-06-27 15:23:36 +02:00
Stephane Nicoll 1b181b2f34 Upgrade to Tomcat 8.5.16
This commit uses the replacement for deprecated APIs in 8.5.16 to ease
a forward compatibility with Tomcat 9

Closes gh-9611
2017-06-27 14:38:02 +02:00
Johnny Lim 533c418ad4 Polish
Closes gh-9610
2017-06-27 08:51:11 +02:00
Andy Wilkinson 5a4ef50ef1 Adapt to API changes in Spring Data Commons 2017-06-26 17:21:14 +01:00
Stephane Nicoll c99a222759 Merge branch '1.5.x' 2017-06-26 17:47:09 +02:00
Stephane Nicoll 85c7643638 Remove use of 'javax.annotation.Resource'
This commit removes the only use of the `javax.annotation.Resource`
annotation from the codebase. This ensures that injection point are
only defined with Spring's annotation model.

Closes gh-9441
2017-06-26 17:46:46 +02:00
Stephane Nicoll 8ea38d1cbe Merge branch '1.5.x' 2017-06-26 13:37:18 +02:00
Stephane Nicoll 58a1ed19a9 Polish 2017-06-26 13:36:57 +02:00
Stephane Nicoll b465d9d815 Remove dead code 2017-06-26 09:07:07 +02:00
Stephane Nicoll e418cad752 Merge branch '1.5.x' 2017-06-23 11:48:17 +02:00
Stephane Nicoll 5aa27beb54 Polish 2017-06-23 11:40:16 +02:00
Stephane Nicoll 90c4e7518b Detect Neo4j https driver url
Closes gh-9549
2017-06-23 11:39:39 +02:00
Stephane Nicoll 27f8a63f1c Polish "Ensure compatibility with Spring Session module split"
Closes gh-9554
2017-06-23 10:34:17 +02:00
Vedran Pavic ccb1eaf8ed Ensure compatibility with Spring Session module split
This commit updates Spring Session auto-configuration to ensure
compatibility with extraction of `SessionRepository` implementations into
separate Spring Session modules.

See gh-9554
2017-06-23 10:00:24 +02:00
Andy Wilkinson f26f8176b6 Start building against Spring Session 2.0 snapshots
See gh-9541
2017-06-23 10:00:05 +02:00
Stephane Nicoll 885e29934b Clean HibernateJpaAutoConfigurationTests
This commit makes sure that each test runs with the proper datasource
auto-configuration and with an isolated embedded database. This allows
to restrict each test to only what it is supposed to do (rather than
disabling initialization to work around the fact that database is not
in a proper state because it is shared).

Closes gh-9579
2017-06-22 17:47:35 +02:00
Stephane Nicoll aac80e0b02 Polish
Closes gh-9570
2017-06-22 09:33:45 +02:00
Stephane Nicoll beb72ca8ee Merge branch '1.5.x' 2017-06-22 09:31:04 +02:00
Johnny Lim 8ca70a7efd Polish
See gh-9570
2017-06-22 09:28:49 +02:00
Stephane Nicoll 35d062f50d Alias spring.datasource.name to Hikari's poolName property
Closes gh-9547
2017-06-20 14:30:18 +02:00
Stephane Nicoll 78a9ace582 Polish 2017-06-20 11:58:51 +02:00
Stephane Nicoll 03b43225b8 Allow Hikari to export MBeans on the auto-configured datasource
This commit makes sure that if the `register-mbeans` property of the
Hikary datasource config is set, Spring Boot doesn't attempt to expose
the mbean again.

Closes gh-5114
2017-06-20 11:49:19 +02:00
Stephane Nicoll 2916cdf953 Polish 2017-06-19 08:38:04 +02:00
Stephane Nicoll 49797b1153 Polish "Add support for CustomConversions with Cassandra"
Closes gh-8534
2017-06-19 08:28:24 +02:00
Eddú Meléndez 744a1ed497 Add support for CustomConversions with Cassandra
This commit add the support for CustomConversions in
spring-data-cassandra. To customize, bean just need to be declared and
it will be auto-configured.

See gh-8534
2017-06-19 08:28:23 +02:00
Madhura Bhave fce299c1c1 Merge branch '1.5.x' 2017-06-16 11:38:18 -07:00
Madhura Bhave e437c4cd67 OAuth2ClientIdCondition should not match if clientId absent
Fixes gh-9435
2017-06-16 10:55:49 -07:00
Andy Wilkinson 2ffe480490 Polish 2017-06-16 09:24:56 +01:00
Andy Wilkinson cbae31364f Suppress deprecation warning from LettuceConnectionFactory
See gh-9538
2017-06-16 09:21:59 +01:00
Andy Wilkinson 991314c63d Merge branch '1.5.x' 2017-06-16 09:13:42 +01:00
Stephane Nicoll 4d6965a147 Polish 2017-06-16 09:26:09 +02:00
Andy Wilkinson 4a030d5a7a Drop support for auto-configuring an embedded Elasticsearch node
Elastic have announced [1] that embedded Elasticsearch is no longer
supported. This commit brings us into line with that announcement by
removing the auto-configuration that would create an Elasticsearch
Node and NodeClient.

To use the Elasticsearch auto-configuration, a user must now provide
the address of one or more cluster nodes
(via the spring.elastisearch.cluster-nodes property) which will then
be used to create a TransportClient.

See gh-9374

[1] https://www.elastic.co/blog/elasticsearch-the-server
2017-06-15 19:52:24 +01:00
Stephane Nicoll 053b8b5853 Polish "Set Lettuce shutdown timeout properly"
Closes gh-9526
2017-06-15 13:49:52 +02:00
Mark Paluch 0a9646dbf4 Reduce Lettuce shutdown timeout to 100ms
Reducing the default to 100ms is a good compromise to retain a quiet time
in for parallel execution and optimize for default, single-threaded
execution (such as test execution or regular application shutdown). The
shutdown timeout can be adjusted to fit specific application needs.

See gh-9526
2017-06-15 13:46:16 +02:00
Mark Paluch 69d2185618 Set Lettuce shutdown timeout properly
We now properly set the Lettuce client shutdown for unpooled and pooled
configuration.

See gh-9526
2017-06-15 13:45:59 +02:00
Stephane Nicoll eb30fe06ec Merge branch '1.5.x' 2017-06-15 13:43:44 +02:00
Stephane Nicoll 5d69318e2d Add reference to SpringBootApplication in EnableAutoConfiguration
Closes gh-9521
2017-06-15 13:43:13 +02:00
Stephane Nicoll 3a63241628 Fix RedisRepositoriesAutoConfiguration condition
Rather than checking if Jedis is on the classpath, this commit changes
the conditions of `RedisRepositoriesAutoConfiguration` to check for the
presence of a `RedisConnectionFactory` bean that is going to be
necessary to create the Redis repositories anyway.

Checking for Jedis is no longer correct since we now support Lettuce as
well.

Closes gh-9523
2017-06-15 11:11:48 +02:00
Stephane Nicoll a4688bdb86 Polish "Use Redis client configuration to configure connection factories"
In particular, the Lettuce code is not using the new builder API when
pooling is required. This will be fixed in a future milestone.

Closes gh-9510
2017-06-14 15:33:56 +02:00
Mark Paluch 866fdb5d91 Use Redis client configuration to configure connection factories
We now use LettuceClientConfiguration and JedisClientConfiguration to
configure connection factories. Client-specific configuration can be
customized by providing LettuceClientConfigurationBuilderCustomizer and
JedisClientConfigurationBuilderCustomizer beans.

See gh-9510, gh-8894, gh-9490
2017-06-14 14:14:07 +02:00
Stephane Nicoll f05f1bcfba Polish "Add support for Kafka batch listener"
This commit reworks the property to be an enum with the list of
supported listener types rather than a boolean that flip to a
batch listener.

Closes gh-9448
2017-06-14 11:15:31 +02:00
mzagar 257f44357e Add support for Kafka batch listener
This commit adds a `spring.kafka.listener.batch-listener` property so
that a batch listener is created automatically.

See gh-9448
2017-06-14 11:15:31 +02:00
Stephane Nicoll be00dfafde Fix build failure
Force the use of the http Neo4j driver as the bolt one attempts to
connect to the server on startup by default (and there is no way to
disable that behaviour).

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

Closes gh-9499
2017-06-13 11:44:25 +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
Andy Wilkinson aecfdc1dd8 Upgrade to Elasticsearch 5.4.1
Closes gh-9476
2017-06-12 18:36:38 +01:00
Andy Wilkinson 6ff449bd78 Align WebFluxAutoConfigurationTests with breaking Framework change
CompositeContentTypeResolver was recently removed [1] and
WebFluxConfigurationSupport now creates a RequestedContentTypeResolver
bean instead. This commit updates WebFluxAutoConfigurationTests
accordingly.

[1] 01a92517bd
2017-06-12 12:18:47 +01:00
Andy Wilkinson f7e9ec5f42 Minimise our usage of SocketUtils.findAvailableTcpPort
Closes gh-9382
2017-06-09 14:45:09 +01:00
Andy Wilkinson 10868519e1 Adapt to breaking API change in Spring Data Commons 2017-06-09 13:53:11 +01:00
Andy Wilkinson f5da19f2db Align HikariDriverConfigurationFailureAnalyzer with latest Framework change
The Framework now throws a CannotGetJdbcConnectionException rather
than an IllegalStateException.
2017-06-09 12:38:07 +01:00
Vedran Pavic a80348753d Fix `QuartzAutoConfigurtion` failure with multiple `Executor` beans
`QuartzAutoConfigurtion` currently blows up if there are multiple
`Executor` beans in the context.

This commit changes the configuration to retrieve `Executor` bean using
`ObjectProvider#getIfUnique` which won't fail in scenarios where there
are multiple `Executor` beans with none marked as `@Primary`.

Closes gh-9434
2017-06-09 09:00:16 +03:00
Johnny Lim bbab520926 Polish
Closes gh-9438
2017-06-09 08:54:55 +03:00
Spring Buildmaster 05d4d0281c Next Development Version 2017-06-08 12:47:16 +00:00
Andy Wilkinson 0061554105 Merge branch '1.5.x' 2017-06-07 17:19:56 +01:00
Andy Wilkinson e5906a6b64 Allow HttpMsgConverter to depend on ConvService without creating a cycle
In an MVC web application, DelegatingWebMvcConfiguration provides the
ConversionService while also consuming WebMvcConfigurerAdapters that,
among other things, can configure HTTP message converters. Boot's
WebMvcConfigurerAdapter, WebMvcAutoConfigurationAdapter, consumes
the HttpMessageConverters bean and uses it to configure Spring MVC's
HTTP message converters. This can create a bean dependency cycle if
an HTTP message converter bean depends, directly or indirectly on
the ConversionService. An example of the cycle is:

┌─────┐
|  jsonComponentConversionServiceCycle.ThingDeserializer defined in …
↑     ↓
|  org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration$EnableWebMvcConfiguration
↑     ↓
|  org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration$WebMvcAutoConfigurationAdapter
↑     ↓
|  org.springframework.boot.autoconfigure.web.HttpMessageConvertersAutoConfiguration
↑     ↓
|  mappingJackson2HttpMessageConverter defined in class path resource [org/springframework/boot/autoconfigure/web/JacksonHttpMessageConvertersConfiguration$MappingJackson2HttpMessageConverterConfiguration.class]
↑     ↓
|  jacksonObjectMapper defined in class path resource [org/springframework/boot/autoconfigure/jackson/JacksonAutoConfiguration$JacksonObjectMapperConfiguration.class]
└─────┘

This commit breaks the cycle by making WebMvcAutoConfigurationAdapter
consume HttpMessageConverters lazily. This allows the adapter to be
created without triggered instantiation of every HTTP message
converter bean and all their dependencies. This allows it to be
injected into DelegatingWebMvcConfiguration without triggering an
attempt to retrieve the ConversionService.

Closes gh-9409
2017-06-07 17:18:09 +01:00
Andy Wilkinson 6b7dfce5c6 Formatting 2017-06-07 17:17:57 +01:00
Andy Wilkinson a03ddd331c Polishing 2017-06-07 17:14:26 +01:00
Andy Wilkinson d0c8f80117 Merge branch '1.5.x' 2017-06-06 11:46:32 +01:00
Andy Wilkinson ad629055fa Ensure that custom static resource locations end with /
Closes gh-9360
2017-06-06 11:39:04 +01:00
Stephane Nicoll 7f420d1268 Polish contribution
Closes gh-9411
2017-06-06 10:52:31 +02:00
Vedran Pavic db060c847d Ensure `QuartzDatabaseInitializer` is initialized before `Scheduler`
If the auto-configured `Scheduler` instance backed by JDBC job store is
used as a dependency in an application component, the initialization of
`Scheduler` will be triggered before `QuartzDatabaseInitializer`. This
will result in failure due to schema not being prepared in time for
`Scheduler` to populate job details.

This commit ensures `QuartzDatabaseInitializer` is initialized before the
auto-configured `Scheduler` by introducing a dependency between the two.

See gh-9411
2017-06-06 10:14:49 +02:00
Stephane Nicoll 540dca7bdd Revisit InfluxDB configuration structure
This commit removes the `client` namespace for InfluxDB as the
component that is created is `InfluxDB`, not `InfluxDBClient` or
something.

This aligns with all the other url/user/password properties Spring
Boot provides already

See gh-9066
2017-06-05 11:00:14 +02:00
Phillip Webb 2c7dd9f519 Polish 2017-06-02 16:00:39 -07:00
Phillip Webb 8f7004738b Merge branch '1.5.x' 2017-06-02 13:48:27 -07:00
Phillip Webb b9fd99e268 Polish 2017-06-02 13:47:28 -07:00
Stephane Nicoll 9624bf14c4 Merge branch '1.5.x' 2017-06-02 17:58:18 +02:00
Stephane Nicoll f11edd1eb3 Add missing `@Configuration` on `EmbeddedDatabaseConfiguration` 2017-06-02 17:42:18 +02:00
Andy Wilkinson 8353843006 Merge branch '1.5.x' 2017-06-02 14:19:52 +01:00
Andy Wilkinson a347383111 Merge branch '1.4.x' into 1.5.x 2017-06-02 14:18:44 +01:00
Andy Wilkinson bf656c70ad Improve MultipartProperties' javadoc
Closes gh-9073
2017-06-02 14:13:26 +01:00
Stephane Nicoll 5e5b7e20ff Merge branch '1.5.x' 2017-06-02 14:57:08 +02:00
Stephane Nicoll c736a1698b Clarify default value of `ConditionalOnMissingBean` on bean methods
Closes gh-9387
2017-06-02 14:55:58 +02:00
Stephane Nicoll 297127e075 Polish "Add influxDB java client auto-configuration"
Closes gh-9066
2017-06-02 10:47:50 +02:00
Sergey Kuptsov 6a70b90128 Add influxDB java client auto-configuration
See gh-9066
2017-06-02 09:57:45 +02:00
Stephane Nicoll ba1bc45a53 Polish "Add PoolingOptions to CasandraProperties"
Closes gh-7946
2017-06-01 16:04:49 +02:00
Vladimir Tsanev 2aafc7daa9 Add PoolingOptions to CasandraProperties
This change allows users to configure some basic pooling
options for cassandra driver via configuration properties.

See gh-7946
2017-06-01 14:33:14 +02:00
Stephane Nicoll 5ea3ab4595 Polish "Allow to customize the JdbcTemplate"
Closes gh-7960
2017-06-01 10:50:52 +02:00
Kazuki Shimizu fa357f0e27 Allow to customize the JdbcTemplate
See gh-7960
2017-06-01 10:50:43 +02:00
Stephane Nicoll ad85902880 Reuse JdbcTemplate in NamedParameterJdbcTemplate
This commit makes sure to reuse an existing or auto-configured
`JdbcTemplate` when auto-configuring a `NamedParameterJdbcTemplate`.

This ensures that whatever customizations have been applied on the
`JdbcTemplate` are properly shared.

Closes gh-4945
2017-06-01 10:08:13 +02:00
Phillip Webb 42762a66b8 Upgrade to Elasticsearch 5.4.0
Upgrade to Elasticsearch 5.4.0 and fix auto-configuration to account for
API changes.

See gh-9374
2017-05-31 21:48:14 -07:00
Stephane Nicoll 6f25131a1d Polish 2017-05-31 17:25:38 +02:00
Andy Wilkinson 5ef29653c7 Polish 2017-05-31 15:05:19 +01:00
Andy Wilkinson a9cecc860c Apply TestPropertyValues to the context under test
Closes gh-9367
2017-05-31 15:05:18 +01:00
Stephane Nicoll eaa34874e8 Polish "Allow customization of MongoClientSettings.Builder"
Closes gh-9341
2017-05-31 15:48:22 +02:00