Commit Graph

348 Commits (34eab5da95b333e625e4cccabb21b6f52a74c9a4)

Author SHA1 Message Date
Stephane Nicoll fd94608f73 Polish "Restore proxying of @Bean methods in @TestConfiguration"
See gh-18675
5 years ago
Andy Wilkinson c75b06c76c Remove @ImmutableConfigurationProperties
Closes gh-18563
5 years ago
Stephane Nicoll 32a1cdf4d3 Polish "Use dedicated method to turn off authentication"
See gh-18538
5 years ago
Michael Simons 04a01a49c2 Use dedicated method to turn off authentication
See gh-18538
5 years ago
Andy Wilkinson 96f85a40de Support customization of WebTestClient.Builder when using @SpringBootTest
Closes gh-15132
5 years ago
Andy Wilkinson 46c30d6bb0 Merge branch '2.1.x'
Closes gh-18476
5 years ago
Andy Wilkinson 3d4157ad6d Correct SCM URLs in published poms
Previously, Maven's default behaviour was relied up which resulted
in the artifact ID being appended to each URL as it was inherited.
This behaviour can only be disabled in Maven 3.6 and later, a version
that we cannot use due to an incompatibility with the Flatten Plugin.

This commit works around Maven's default behaviour by defining
properties for the SCM URL, connection, and developer connection and
then explicitly defining the settings in each pom using these
properties. The explicit definition of the properties in each pom
prevents them being inherited from the parent, thereby disabling the
unwanted appending of the artifact ID to the URL.

Fixes gh-18328
5 years ago
Phillip Webb b65ba60980 Polish 'Simplify some code'
See gh-18438
5 years ago
Phillip Webb e41c5a4327 Require annotation signal for constructor binding
Update `@ConfigurationProperties` constructor binding support to only
apply when a `@ConstructorBinding` annotation is present on either the
type or the specific constructor to use.

Prior to this commit we didn't have a good way to tell when constructor
binding should be used vs regular autowiring.

For convenience, an `@ImmutableConfigurationProperties` meta-annotation
has also been added which is composed of `@ConfigurationProperties` and
`@ConstructorBinding`.

Closes gh-18469
5 years ago
Phillip Webb ecf751e7eb Polish 5 years ago
Andy Wilkinson 79d8089cd0 Remove redundant spring-plugin-core dependencies
Closes gh-18317
5 years ago
Andy Wilkinson 6534047fcf Rework test slice annotation javadoc to reflect JUnit 5 default
Closes gh-18178
5 years ago
dreis2211 07b857e57a Use disabledWithoutDocker option for @Testcontainers
See gh-18095
5 years ago
dreis2211 b4350a9d96 Remove unnecessary blank lines
See gh-18089
5 years ago
freekry e1611287c8 Simplify some code
See gh-18077
5 years ago
Andy Wilkinson 2d2e3b3d8b Support parallel test execution with @AutoConfigureMockMvc
Previously, the deferred line writing that is used, to print MockMvc
results to the console assumed that each DeferredLinesWriter would
only be used by a single thread at a time. This assumption does not
hold true when using JUnit 5's parallel test exection if the tests
running in parallel share an application context. This resulted in
a concurrent modification exception if one thread was adding lines
to the output while another was iterating over them.

This commit updates DeferredLinesWriter so that it uses thread local
storage for the deferred lines. This ensures that each List of lines
is only ever accessed by a single thread.

Closes gh-16179
5 years ago
Phillip Webb 94b5ad0f7e Fixup tests following upstream HATEOAS changes
See gh-17755
5 years ago
Phillip Webb da4f436140 Change SearchStrategy EXHAUSTIVE to TYPE_HIERARCHY
Fixup references following upstream Spring Framework change.
5 years ago
Phillip Webb 6675f49334 Switch to multi-line security configuration
Now that we have lambda style security configuration we can further
improve readability by switching to one statement per line.

See gh-17525
5 years ago
Madhura Bhave 39a7b9da38 Switch to lambda style security configuration
Closes gh-17525
5 years ago
Phillip Webb 8bc780762a Merge branch '2.1.x' 5 years ago
Phillip Webb fb1dd8fe93 Merge branch '2.0.x' into 2.1.x 5 years ago
Phillip Webb 913e831f4e Merge '1.5.x' into 2.0.x 5 years ago
Dmytro Nosan 9d052bbe5e Include WebFilter beans in WebFluxTest slice
See gh-17601
5 years ago
Dmytro Nosan 6859a89cf3 Include HandlerInterceptor beans in WebMvcTest slice
See gh-17600
5 years ago
Stephane Nicoll e5ca9df478 Merge branch '2.1.x' 5 years ago
Stephane Nicoll 8eb6886388 Fix code formating 5 years ago
Stephane Nicoll 08afbe286c Merge branch '2.1.x'
Closes gh-17580
5 years ago
Stephane Nicoll b8d92cb0ae Fix @DataJdbcTest to be transactional as advertized
Closes gh-17513
5 years ago
Stephane Nicoll 5903e9a57a Polish 5 years ago
Phillip Webb 30b5ba87ae Merge branch '2.0.x' into 2.1.x 5 years ago
Andy Wilkinson 808b373def Merge branch '2.1.x'
Closes gh-17552
5 years ago
Andy Wilkinson 9dabc0e14d Cleared deferred lines after each test
Previously, DeferredLinesWriter would collect MockMvc output from
every test that has executed. If a test eventually failed, the
output from every test up to including the one that had failed would
be output, rather than just the output for the test that has just
failed.

This commit clears the deferred lines after each test, thereby
ensuring that when a failure occurs only the lines from the failing
test are output.

Fixes gh-17551
5 years ago
Stephane Nicoll a3e94f4412 Harmonize component scan in slice tests
This commit updates ConfigurationPropertiesScanRegistrar to apply the
same component scan filters than the ones applied on standard classpath
scanning.

As a result, configuration properties scanning is automatically disabled
in slice tests and can be included by an explicit import or a dedicated
TypeFilter implementation if necessary.

Closes gh-16659
5 years ago
Phillip Webb eff1147ccc Rename classpath runner package
Remove `runner` since we're no longer tied to JUnit 4.

See gh-17491
5 years ago
Phillip Webb 1117fdb2b3 Make ModifiedClassPathExtension package private
Meta-annotate `ClassPathExclusions` and `ClassPathOverrides` with
so that the `ModifiedClassPathExtension` no longer needs to be
used directly.

See gh-17491
5 years ago
Phillip Webb 4fe5e9e31e Remove direct junit-platform-launcher dependency
Replace any direct `junit-platform-launcher` dependencies and instead
rely on the test runner providing it. Launcher related class are not
handled via reflection.

This update allows us to workaround SUREFIRE-1679.

Closes gh-17517
5 years ago
dreis2211 0f0278e69b Migrate ModifiedClassPath tests to JUnit 5
Migrate the remaining JUnit 4 tests to JUnit 5, making use of the
new `ModifiedClassPathExtension`.

See gh-17491
5 years ago
dreis2211 ca1808ecae Migrate to MockRestServiceServer
Migrate `RestClientTestWithoutJacksonIntegrationTests` to use
Spring's `MockRestServiceServer`.

See gh-17491
5 years ago
Phillip Webb 01933f9b06 Merge previously split strings
Merge some string lines that were previously split because of the
90 chars wide formatting.
5 years ago
Phillip Webb c3816bfe7b Polish output capture names 5 years ago
Phillip Webb a66c4d3096 Unify method visibility of private classes
Apply checkstyle rule to ensure that private and package private
classes do not have unnecessary public methods. Test classes have
also been unified as much as possible to use default scoped
inner-classes.

Closes gh-7316
5 years ago
Phillip Webb 605599138e Merge branch '2.1.x' 5 years ago
Phillip Webb 92bff3c328 Merge branch '2.0.x' into 2.1.x 5 years ago
Phillip Webb cfeb0239b7 Merge branch '1.5.x' into 2.0.x 5 years ago
Phillip Webb c62b6b4ccd Merge branch '2.1.x' 5 years ago
Phillip Webb de35efd1ef Merge branch '2.0.x' into 2.1.x 5 years ago
Phillip Webb bb34846630 Merge branch '1.5.x' into 2.0.x 5 years ago
Stephane Nicoll e560b7f6ba Remove public modifier on JUnit5 lifecycle methods
See gh-17292
5 years ago
Andy Wilkinson a189e4cf96 Merge branch '2.1.x'
Closes gh-17220
5 years ago
Andy Wilkinson 645514f848 Polish "Honour base path from @WebAppConfiguration in @WebMvcTest"
See gh-16485
5 years ago
Lorenzo Dee 7340d546b8 Honour base path from @WebAppConfiguration in @WebMvcTest
See gh-16485
5 years ago
Andy Wilkinson 78f51a490c Merge branch '2.1.x'
Closes gh-17213
6 years ago
Andy Wilkinson c2a4a3f630 Polish "Auto-configure caching in jOOQ sliced tests"
See gh-17066
6 years ago
Dmytro Nosan 4701d8f82a Auto-configure caching in jOOQ sliced tests
See gh-17066
6 years ago
Phillip Webb b3d5cd538d Add JUnit 5 checkstyle rules
Add a rule to enforce JUnit 5 usage and conventions.

Closes gh-17093
6 years ago
Andy Wilkinson b18fffaf14 Move tests to JUnit 5 wherever possible 6 years ago
Andy Wilkinson aef92b9295 Merge branch '2.1.x'
Closes gh-17079
6 years ago
Andy Wilkinson 24925c3dae Merge branch '2.0.x' into 2.1.x
Closes gh-17078
6 years ago
Andy Wilkinson c6c139d980 Merge branch '1.5.x' into 2.0.x 6 years ago
Phillip Webb d306b31ce9 Merge branch '2.1.x' 6 years ago
Phillip Webb ccfbd03482 Merge branch '2.0.x' into 2.1.x 6 years ago
Phillip Webb 5fba43aa31 Merge branch '1.5.x' into 2.0.x 6 years ago
fidel 2ec0996a6f Fix typo in javadoc
See gh-17044
6 years ago
Phillip Webb 0fcc561163 Update copyright header of changed files 6 years ago
Andy Wilkinson 0644a79401 Repackage output capture and always use extension declaratively
Closes gh-17029
6 years ago
Phillip Webb ad5e905bd7 Update copyright header of changed files 6 years ago
Phillip Webb 68aec8b6ee Polish 6 years ago
Andy Wilkinson 080a2f5c3b Align with Framework’s removal of charset attribute from application/json
Closes gh-16979
6 years ago
Andy Wilkinson 23f803c6b6 Upgrade to Hamcrest 2.1, switch to hamcrest artifact from -core and -library
Closes gh-15555
6 years ago
Johnny Lim 652906ec7c Use MergedAnnotation.getRoot() in PropertyMappingCheckBeanPostProcessor
Closes gh-16745
6 years ago
Phillip Webb 3a9ca5fa30 Update copyright header of changed files 6 years ago
Phillip Webb ed998ef0d3 Update copyright header of changed files 6 years ago
Madhura Bhave f1786c357b Revert "Disable ConfigurationProperties scanning for slice tests"
This reverts commit 3b4ff7d746.
The commit caused the build to fail because it disabled
`@ConfigurationPropertiesScan` completely in slice tests. It
did not take into account components that were explicitly included
in slice tests using the `components` attribute. Since `@ConfigurationPropertiesScan`
replaces `@Component` and `@EnableConfigurationProperties`, these components
are no longer registered even though explicitly included.
6 years ago
Madhura Bhave 3b4ff7d746 Disable ConfigurationProperties scanning for slice tests
Closes gh-16659
6 years ago
Andy Wilkinson 552345fcd1 Disable more @Bean method proxying
Previously, due to a quirk in Spring Framework, it was necessary to use bean method
proxying in @Configuration classes that define one or more FactoryBeans. This quirk has
now been addressed so this commit disables bean method proxying where it is now no longer
needed.

Closes gh-16533
6 years ago
Madhura Bhave 684a1c7a3c Migrate tests to JUnit5 testcontainer extensions
Closes gh-15456
6 years ago
Phillip Webb 17aaf26590 Use consistent javadoc style for annotation links
Closes gh-13920
6 years ago
Phillip Webb 1e44aba772 Fix compiler warnings and polish
Fix various compiler warnings and apply a little polish.
6 years ago
Phillip Webb b879972d0d Migrate to MergedAnnotations API
Migrate away from `AnnotationUtils` and `AnnotatedElementUtils`
when possible to the new `MergedAnnotations` API.

Closes gh-16551
6 years ago
Madhura Bhave dabe75a281 Merge branch '2.1.x' 6 years ago
Madhura Bhave f0544fb86f Polish 6 years ago
Madhura Bhave 1d20c73d22 Make nested classes in JsonTestersAutoConfiguration package private
Closes gh-15444
6 years ago
Johnny Lim 4392d7c2ed Polish
Closes gh-16494
6 years ago
Stephane Nicoll c432288ed1 Migrate ApplicationContext to common hierarchy
This commit migrates `AnnotationConfigReactiveWebApplicationContext`
parent to the `GenericApplicationContext` abstraction. Any use of
`AnnotationConfigWebApplicationContext` is also removed as it also
inherits from the `AbstractRefreshableApplicationContext` outdated
hierarchy.

A new `AnnotationConfigServletWebApplicationContext` context is
introduced instead, extending from `GenericApplicationContext` and
providing the counter part of the reactive context for the Servlet-based
web app tests.

See gh-16096
6 years ago
Phillip Webb ad7eebee9e Merge branch '2.1.x' 6 years ago
Phillip Webb f12ab1ff90 Update copyright header of changed files 6 years ago
Phillip Webb 2376f973f4 Merge branch '2.1.x' 6 years ago
Phillip Webb 47c6bf741d Merge branch '2.0.x' into 2.1.x 6 years ago
Phillip Webb 07c000c5b7 Merge branch '1.5.x' into 2.0.x 6 years ago
Stephane Nicoll 270554d3cd Merge branch '2.1.x' 6 years ago
Stephane Nicoll 090f5f5397 Polish "Add error rendering support with @WebFluxTest"
Closes gh-16266
6 years ago
Ali Dehghani 53e7484d87 Add error rendering support with @WebFluxTest
See gh-16266
6 years ago
Andy Wilkinson 878a635bfb Merge branch '2.1.x' 6 years ago
Andy Wilkinson 864942ad4f Merge branch '2.0.x' into 2.1.x 6 years ago
Andy Wilkinson ba4671f0ab Merge branch '1.5.x' into 2.0.x 6 years ago
Madhura Bhave 0d136f0573 Merge branch '2.1.x' 6 years ago
Madhura Bhave 0a54fb73fa Remove redundant include from WebFluxTypeExcludeFilter
For webflux, security configuration is configured via a bean of type
`SecurityWebFilterChain` and not `ServerHttpSecurity`. We would have changed
the include to be `SecurityWebFilterChain` but the filter only applies to
beans registered via component scanning and not those registered in
`@Configuration` classes, making the includes redundant.

See gh-16088
6 years ago
Andy Wilkinson 36c1c051b8 Merge branch '2.1.x' 6 years ago
Andy Wilkinson e23f72c8b0 Merge branch '2.0.x' into 2.1.x 6 years ago