Commit Graph

242 Commits

Author SHA1 Message Date
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
Michael J. Simons 00a643f9d8 Add @JooqTest
This commit provides test slicing for jOOQ.

See gh-9343
2017-05-31 14:41:28 +02:00
Madhura Bhave d745b69630 Replace usages of EnvironmentTestUtils 2017-05-24 14:59:04 -07:00
Andy Wilkinson d5438c299c Polish "Use try-with-resources to close resources automatically"
- Apply code formatting
- Use try-with-resources in many other places that were missed in the
  pull request

Closes gh-8045
2017-05-23 19:38:48 +01:00
Johnny Lim 53e5d67cde Polish
Closes gh-9103
2017-05-07 10:32:12 +02:00
Stephane Nicoll 5247fa323b Harmonize reactive auto-configuration class names
Closes gh-9086
2017-05-04 10:19:10 +02:00
Phillip Webb 06558675bb Polish 2017-04-25 09:45:14 -07:00
Madhura Bhave c2e5fd031a Replace usage of WebMvcConfigurerAdapter
Closes gh-8964
2017-04-24 15:31:39 -07:00
Spring Buildmaster 9768b0a8c2 Next Development Version 2017-04-21 08:32:01 +00:00
Phillip Webb 9981ae6874 Rename WebFluxAnnotationAutoConfiguration
Rename WebFluxAnnotationAutoConfiguration to WebFluxAutoConfiguration
to better align with Spring MVC.
2017-04-20 16:02:49 -07:00
Phillip Webb 94209e2883 Merge branch '1.5.x' 2017-04-18 15:06:43 -07:00
Phillip Webb 8eb79b3c0f Polish 2017-04-18 11:13:12 -07:00
Phillip Webb 383640d5ec Merge branch '1.5.x' 2017-04-17 22:15:33 -07:00
Phillip Webb f46d799f31 Polish 2017-04-17 22:08:51 -07:00
Madhura Bhave ed072abaef Merge branch '1.5.x' 2017-04-17 11:42:02 -07:00
Madhura Bhave 9e2d54feae Support json view with JacksonTester
Closes gh-8672
2017-04-17 11:14:26 -07:00
Phillip Webb 700f0ea93c Fix WebClientTest calls
Update calls to WebClientTest following upstream changes.
2017-04-14 16:26:01 -07:00
Stephane Nicoll 04ee374e7f Polish "Add slice test annotation for LDAP"
Closes gh-8536
2017-04-14 10:51:43 +02:00
Eddú Meléndez 2830bef95c Add slice test annotation for LDAP
This commit adds new annotation `@DataLdapTest` which provides test
infrastructure for LDAP. By default, embedded ldap server is initialized
if available.

See gh-8536
2017-04-14 10:39:03 +02:00
dreis f3bbbc4530 Use JDK hashCode() variants for primitives
See gh-8768
2017-04-12 15:22:14 +02:00
Stephane Nicoll 12170f53e2 Restore DataMongoTestReactiveIntegrationTests
Closes gh-8885
2017-04-12 11:23:30 +02:00
Phillip Webb d21a5076fe Upgrade to Reactor BOM Bismuth SNAPSHOT
See gh-8884
2017-04-11 14:53:46 -07:00
Johnny Lim 0cd1285aa4 Polish
Closes gh-8879
2017-04-11 09:41:33 +02:00
Stephane Nicoll 5b92a0278b Merge branch '1.5.x' 2017-04-11 09:41:08 +02:00
Stephane Nicoll 934d33685a Polish
See gh-8879
2017-04-11 09:40:54 +02:00
Phillip Webb 2de7e9c310 Merge branch '1.5.x' 2017-04-04 10:07:38 -07:00
Phillip Webb ad38776de3 Polish 2017-04-04 09:48:10 -07:00
Stephane Nicoll b08016f15a Polish "Add @DataNeo4jTest" contribution
Closes gh-8618
2017-04-02 12:38:24 +02:00
Eddú Meléndez b6feb47574 Add @DataNeo4jTest
This commit adds test infrastructure for Neo4j repositories through
`@DataNeo4jTest`.

See gh-8618
2017-04-02 08:21:00 +02:00
Andy Wilkinson 28a5ffcce6 Fix DataJpaTestIntegrationTests
Closes gh-7612
2017-03-24 22:46:03 +00:00
Andy Wilkinson 2fd51dd8a1 Upgrade to Spring REST Docs 1.2.0.RC1
Closes gh-8716
2017-03-24 21:12:21 +00:00
Madhura Bhave 9bacca7aa0 Merge branch '1.5.x' 2017-03-23 15:23:44 -07:00
Madhura Bhave f73714bdcc Do not filter HttpMessageConverters in WebMvcTest
Closes gh-8617
2017-03-23 14:21:04 -07:00
Madhura Bhave 356b78b77f Stop autoconfiguration from being scanned in tests
These tests used to pass even without explicitly adding the autoconfigure
annotation. Moving them to a subpackage prevents scanning of the
autoconfiguration by component scanning.

Closes gh-8645
2017-03-17 10:33:44 -07:00