Commit Graph

571 Commits

Author SHA1 Message Date
Moritz Halbritter 66ed4fe519 Remove system property dependency from MockBeanContextCachingTests
Now this test can be run regardless of the
'spring.test.context.cache.maxSize' system property value.

See gh-38236
2023-11-08 09:49:35 +01:00
Phillip Webb abdad1cabe Constently use assertThatExceptionOf... assertions
Closes gh-37964
2023-10-19 20:17:26 -07:00
Andy Wilkinson 4cc3aec587 Consider @ComponentScan in imports context cache key
Fixes gh-31577
2023-10-18 10:40:23 +01:00
Andy Wilkinson 21de3fba3c Describe quirks of JUL and Log4j2 in OutputCaptureExtension javadoc
Closes gh-32562
2023-08-09 12:25:26 +01:00
Andy Wilkinson f4c996b432 Polish "Check for Class and ResolvableType object type attributes"
See gh-36224
2023-07-05 09:04:58 +01:00
Bernardo Bulgarelli 3a7185206e Check for Class and ResolvableType object type attributes
See gh-36224
2023-07-05 09:04:04 +01:00
Phillip Webb 5d0640a356 Use MergedAnnotations for `@AliasFor` support
Update `ImportsContextCustomizer` to use `MergedAnnotations` so
that `@AliasFor` can be supported.

See gh-34917
2023-07-04 12:17:58 +01:00
Laurent Martelli 9baf23ccd5 Test that ImportsContextCustomizer can support @AliasFor
Add test to ensure that `ImportsContextCustomizer` can support
`@AliasFor` annotations.

See gh-34917
2023-07-04 12:17:58 +01:00
Andy Wilkinson 6dc84b1645 Ignore non-singleton factory beans when resetting mocks
Closes gh-35324
2023-05-05 18:21:04 +01:00
Mortitz Halbritter bece347987 Polish 2023-03-23 22:59:26 -07:00
Phillip Webb a5902d7a00 Update copyright year of changed files 2023-02-22 18:35:17 -08:00
Phillip Webb df5898a146 Reformat code following spring-javaformat upgrade 2023-02-21 22:53:27 -08:00
Andy Wilkinson 9940fcfe77 Reset mocks produced by FactoryBeans
An unwanted side-effect of the changes made in c6bdd136 to fix
gh-7271 is that a mock produced by a factory bean is not reset. To
allow such a mock to be reset without regressing the fix we now call
getBean(…) as we did before c6bdd136, however the call is now
performed in a defensive manner falling back to getSingleton(…) when
it fails.

Closes gh-33830
2023-02-01 17:22:36 +00:00
Johnny Lim 5eeb429e44 Polish
See gh-33966
2023-01-31 10:48:30 +01:00
Krzysztof Krason a8958471f6 Switch anonymous inner classes to lambdas
See gh-33987
2023-01-26 19:34:22 -08:00
Phillip Webb 7c508fa324 Update copyright year of changed files 2023-01-18 15:37:58 -08:00
Moritz Halbritter e8d809fe65 Replace 'via' with 'over' or 'through' in the documentation
Closes gh-33878
2023-01-18 16:56:42 +01:00
Phillip Webb a0fe8241a7 Update copyright year of changed files 2023-01-17 10:07:03 -08:00
Moritz Halbritter d652491e20 Fix stack overflow in SpringBootMockResolver
Closes gh-32632
2023-01-12 13:24:09 +01:00
Phillip Webb e4772cf3b7 Update copyright year of changed files 2022-12-22 00:59:32 -08:00
Moritz Halbritter 6edb6fa091 Polish "Add test for beforeEach of OutputExtension"
See gh-33419
2022-12-01 11:44:04 +01:00
nowjin 5f532a40f9 Add test for beforeEach of OutputExtension
See gh-33419
2022-12-01 11:41:28 +01:00
Phillip Webb 711e2528fb Polish 'Improve test coverage for OutputCaptureRule'
See gh-33405
2022-11-29 14:09:26 -08:00
nowjin af7a03b4c9 Improve test coverage for OutputCaptureRule
See gh-33405
2022-11-29 14:09:05 -08:00
Andy Wilkinson 6bf35e3dd0 Merge branch '2.6.x' into 2.7.x
Closes gh-33262
2022-11-18 15:49:12 +00:00
Andy Wilkinson 0c8ae65bd4 Switch of the banner when SpringBootTest runs an app with a parent
Closes gh-33079
2022-11-18 15:43:41 +00:00
Phillip Webb c8676a81de Merge branch '2.6.x' into 2.7.x 2022-10-25 15:48:04 -07:00
Phillip Webb d7ac20cd6c Update copyright year of changed files 2022-10-25 15:47:30 -07:00
Phillip Webb 0f4d98b1f4 Merge branch '2.6.x' into 2.7.x
Closes gh-32575
2022-10-03 17:56:10 -07:00
Phillip Webb e917bd0ed0 Only build OutputCapture strings when necessary
Update `OutputCapture` so that expensive build operations are only
performed when necessary. This update is especially important for Kotlin
users calling `"Expected String" in output` since this results in a call
to Kotlin's `CharSequence.contains` which calls the `length()` and
`charAt()` methods many times.

Closes gh-32033
2022-10-03 16:55:44 -07:00
Stephane Nicoll 33680e5acc Merge branch '2.6.x' into 2.7.x
Closes gh-32509
2022-09-27 08:28:15 +02:00
dreis2211 cee353fba6 Avoid using JUnit 4 assertions
See gh-32504
2022-09-27 08:11:47 +02:00
Phillip Webb a4ef6a7c5c Merge branch '2.6.x' into 2.7.x
Closes gh-31865
2022-07-26 12:13:16 +01:00
Phillip Webb f8412847dc Update copyright year for "Fix typos in code and documentation"
See gh-31734
2022-07-26 12:08:30 +01:00
Marc Wrobel dbfc6bded4 Fix typos in code and documentation
See gh-31734
2022-07-26 12:08:07 +01:00
Andy Wilkinson 935d1264e0 Merge branch '2.6.x' into 2.7.x 2022-05-26 18:13:08 +01:00
Andy Wilkinson 3d203d0215 Polish 2022-05-26 17:30:39 +01:00
Andy Wilkinson 455ee0ce22 Merge branch '2.6.x' into 2.7.x
Closes gh-31177
2022-05-26 15:53:38 +01:00
Andy Wilkinson ee45fd2fc8 Remove redundant throws declarations from internal APIs
Closes gh-31176
2022-05-26 15:47:35 +01:00
Andy Wilkinson b3a4982f31 Merge branch '2.6.x' into 2.7.x
Closes gh-31174
2022-05-26 14:01:23 +01:00
Andy Wilkinson cbf42dea14 Update deprecation messages to change removal version from 2.8 to 3.0
Closes gh-30903
2022-05-26 13:59:03 +01:00
Brian Clozel 5352c441e1 Do not use application/graphql as default MIME type
As seen in spring-projects/spring-graphql#375, Spring Boot should also
use "application/json" as the default MIME type but remain compatible
with "application/graphql+json" still if clients POST content with this
type or explicitly accept it.

Closes gh-30860
2022-05-04 13:05:45 +02:00
Andy Wilkinson 7789a18d23 Merge branch '2.6.x' into 2.7.x
Closes gh-30667
2022-04-14 14:51:22 +01:00
Andy Wilkinson d4348279a7 Merge branch '2.5.x' into 2.6.x
Closes gh-30666
2022-04-14 14:51:09 +01:00
Andy Wilkinson 8f1b8622ba Ensure that webEnvironment=NONE creates non-web context
Previously, if spring.main.web-application-type was configured in
application.properties to servlet or reactive, setting
webEnvironment=NONE on @SpringBootTest would not work correctly and
a servlet or reactive web application context would be created
based on the value of spring.main.web-application-type.

This commit updates the test context bootstapper to set
spring.main.web-application-type to none when webEnvironment has been
set to none. This is done in the merged context configuration's
property source properties which are applied to the environment in a
high-precedence test property source that will override configuration
in application.properties.

Closes gh-29695
2022-04-14 14:44:30 +01:00
Andy Wilkinson 4545d39603 Merge branch '2.6.x' into 2.7.x
Closes gh-30665
2022-04-14 13:28:39 +01:00
Andy Wilkinson 887fa4a13f Merge branch '2.5.x' into 2.6.x
Closes gh-30664
2022-04-14 12:40:29 +01:00
Andy Wilkinson c8de843d85 Honor final web application type when creating context in tests
Previously, SpringBootContextLoader would configure its
SpringApplication with an ApplicationContextFactory that ignores
the WebApplicationType with which its called and instead returns a
hard-coded type of context based on the type of the
MergedContextConfiguration. This hard-coding would result in the
wrong type of context being used if a subsequent change was made to
the application's WebApplicationType, for example due to binding of
the spring.main.web-application-type configuration property.

This commit updates SpringBootContextLoader to configure
SpringApplication with an ApplicationContextFactory that takes the
WebApplicationType with which it is called into consideration.

Fixes gh-29170
2022-04-14 12:26:07 +01:00
Andy Wilkinson 48f8021d88 Migrate @Local*Port annotations to spring-boot-test
Closes gh-29589
2022-04-12 08:48:43 +01:00
Brian Clozel 1c71567c94 Support "application/graphql+json" media type in GraphQL HTTP mapping
As seen in spring-projects/spring-graphql#108, the GraphQL HTTP spec now
requires the "application/graphql+json" media type and accepts
"application/json" for backwards compatibility.

This commit updates the `RouterFunction` definition for the GraphQL HTTP
endpoints so that both types are accepted.

Closes gh-30407
2022-04-04 16:45:11 +02:00