Commit Graph

273 Commits (60a4567bc4121353ec1a86cd81c642457dd6680d)

Author SHA1 Message Date
Phillip Webb 2c97d3a5e9 Polish 7 years ago
Johnny Lim 118f65556f Remove unused ExpectedExceptions
Closes gh-10101
7 years ago
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
7 years ago
Johnny Lim 14c9f91aab Polish
Closes gh-10054
7 years ago
Stephane Nicoll 394371eb73 Polish "Harmonize database initializers"
Closes gh-9752
7 years ago
Andy Wilkinson 66f9696a44 Merge branch '1.5.x' 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
Phillip Webb 9127c48fb5 Fixup warnings 7 years ago
Spring Buildmaster 17a5bb0be4 Next development version 7 years ago
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
7 years ago
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
7 years ago
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
7 years ago
Spring Buildmaster 41c5c0e7c9 Next development version 7 years ago
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
7 years ago
Emanuel Campolo 2626a3a795 Use lambdas when possible
Replace anonymous inner classes with lambda declarations (when possible
using method references).

See gh-9781
7 years ago
Emanuel Campolo 04fdec6f8b Replace explicit generics with diamond operator
Where possible, explicit generic declarations to use the Java 8 diamond
operator.

See gh-9781
7 years ago
Phillip Webb 7b2b8dc4a3 Merge branch '1.5.x' 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 dff9fb12aa Merge branch '1.5.x' 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 e1ef2a591f Fixup tests to use new ApplicationContextTester
Update existing tests that previously use `ContextLoader` to the newly
introduced `*ApplicationContextTester` classes.

See gh-9634
7 years ago
Phillip Webb 8e3baf3130 Polish 7 years ago
Stephane Nicoll cb13c98649 Polish 7 years ago
Stephane Nicoll ef5c2afcc9 Polish 7 years ago
Andy Wilkinson dd0ce54425 Improve the type-safety of ContextLoader for servlet and reactive web 7 years ago
Andy Wilkinson 19ddfad63e Migrate some more tests to the new ContextLoader 7 years ago
Phillip Webb eb17aa06f9 Merge branch '1.5.x' 7 years ago
Phillip Webb aa57ca7e18 Polish 7 years ago
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
7 years ago
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
7 years ago
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
7 years ago
Andy Wilkinson dc020ffa6c Merge branch '1.5.x' 8 years ago
Andy Wilkinson 99d53a5980 Polish 8 years ago
Andy Wilkinson 43319a4484 Merge branch '1.5.x' 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 991314c63d Merge branch '1.5.x' 8 years ago
Andy Wilkinson 59122358d3 Clean up and format code 8 years ago
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
8 years ago
Stephane Nicoll dd53ed0aec Polish "Add Slice test annotation for Redis"
Closes gh-9224
8 years ago
Jayaram Pradhan 2d36d2a7e4 Add Slice test annotation for Redis
This commit adds new annotation `@DataRedisTest` which provides test
infrastructure for redis.

See gh-9224
8 years ago
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
8 years ago
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
8 years ago
Spring Buildmaster 05d4d0281c Next Development Version 8 years ago
Phillip Webb 2c7dd9f519 Polish 8 years ago
Stephane Nicoll d096dcad1d Polish "Add @JooqTest"
Closes gh-9343
8 years ago
Michael J. Simons 00a643f9d8 Add @JooqTest
This commit provides test slicing for jOOQ.

See gh-9343
8 years ago
Madhura Bhave d745b69630 Replace usages of EnvironmentTestUtils 8 years ago