Commit Graph

498 Commits

Author SHA1 Message Date
Juergen Hoeller 0eb937a866 Document limitations of CGLIB proxy class generation in JPMS module setups
Includes extended exception messages with common hints and explanations.

Closes gh-32671
2024-05-08 17:51:17 +02:00
Sam Brannen ac0136b75c Clarify supported targets for annotations in the TestContext framework
Closes gh-32772
2024-05-07 16:45:12 +03:00
Sébastien Deleuze 39889744b0 Polish JdbcTemplate Best Practices section 2024-05-06 18:28:54 +02:00
Sébastien Deleuze 04944a1f56 Modernize the lazy-initialized beans refdoc section
Closes gh-32767
2024-05-06 17:08:49 +02:00
Sébastien Deleuze c6459b40e4 Modernize the integration section of the refdoc
This commit adds Java and Kotlin tabs to XML code snippets where
relevant, and leverages code includes.

Closes gh-32600
2024-05-06 16:05:35 +02:00
Sébastien Deleuze a8430878ca Merge branch '6.1.x' 2024-05-02 11:08:30 +02:00
Sébastien Deleuze f17527a48b Use expectBody<Person>() in WebTestClient documentation
Closes gh-32733
2024-05-02 11:07:36 +02:00
Sam Brannen 512ff7ce3c Merge branch '6.1.x' 2024-04-30 18:09:41 +03:00
Seungrae Kim 32c80d5ae6 Fix incorrect class reference syntax in Kotlin code sample
Closes gh-32733
2024-04-30 18:09:02 +03:00
Juergen Hoeller f1a1190700 Merge branch '6.1.x'
# Conflicts:
#	framework-docs/modules/ROOT/pages/data-access/transaction/declarative/annotations.adoc
2024-04-30 15:47:48 +02:00
Juergen Hoeller 7263771552 Add documentation for CompletableFuture-driven rollback
Closes gh-32709
2024-04-30 15:45:56 +02:00
Juergen Hoeller fab3633c75 Add notes on constructor and factory method overloading
Closes gh-32091
2024-04-30 15:45:46 +02:00
Sébastien Deleuze b232aefdeb Use lowercase package in code snippets
Closes gh-32734
2024-04-30 15:05:15 +02:00
Sam Brannen 00da781c44 Merge branch '6.1.x' 2024-04-24 15:33:19 +03:00
Sam Brannen 546ca9b834 Polishing 2024-04-24 15:32:57 +03:00
Stéphane Nicoll a77895bd90 Merge branch '6.1.x' 2024-04-23 15:34:49 +02:00
Johnny Lim cc73ccefef Polish
See gh-32696
2024-04-23 15:31:48 +02:00
Stéphane Nicoll af4a986256 Merge branch '6.1.x' 2024-04-23 12:43:40 +02:00
Stéphane Nicoll 40596d444c Provide a more explicit link to URI composition examples
Closes gh-32685
2024-04-23 12:43:15 +02:00
Stéphane Nicoll 4e1b8f9be3 Merge branch '6.1.x' 2024-04-23 11:04:02 +02:00
Stéphane Nicoll cb5b9dcaed Document AOT limitation of creating beans with custom arguments
Closes gh-32690
2024-04-23 11:03:28 +02:00
Simon Baslé a985c0bb35 Polishing: fix link fragments in test bean override annotation pages 2024-04-18 14:54:57 +02:00
Michael Kunze 00c7002354 Fix typo in class name
Closes gh-32664
2024-04-18 09:32:10 +02:00
Sam Brannen 8727d723f3 Polish "Bean Overriding in Tests" support 2024-04-16 17:08:15 +02:00
Arjen Poutsma 051fd2ae4f Merge branch '6.1.x' 2024-04-16 11:44:02 +02:00
Arjen Poutsma 3971632415 Reintroduce SimpleClientHttpRequestFactory limitations
Closes gh-32641
2024-04-16 11:43:09 +02:00
Simon Baslé 02ee5de470 Document bean override in TestContext framework section of the manual
This change splits the documentation in the reference manual: the
`@TestBean`, `@MockitoBean` and `@MockitoSpyBean` annotations are kept
in the appendix and the general documentation about the feature is moved
into a dedicated sub-section of the TCF section.

Close gh-32490
2024-04-15 17:07:14 +02:00
Sam Brannen 43cc18a5a1 Use literal monospace in SpEL templating section
Prior to this commit, the text `#{ }` was displayed as { } with a bright
green background.

This commit addresses this by making use of Asciidoc's literal monospace
feature: `+#{ }+`.
2024-04-11 14:00:46 +02:00
Stéphane Nicoll 2e3a923225 Polish 2024-04-11 08:45:26 +02:00
Simon Baslé 2d33aac350 Improve Bean Overriding support, testing and documentation
This commit improves on the bean overriding feature in several ways:
the API is simplified and polished (metadata and processor contracts,
 etc...).

The commit also reworks infrastructure classes (context customizer,
test execution listener, BeanOverrideBeanFactoryPostProcessor, etc...).
Parsing of annotations is now fully stateless.

In order to avoid OverrideMetadata in bean definition and to make a
first step towards AOT support, the BeanOverrideBeanFactoryPostProcessor
now delegates to a BeanOverrideRegistrar to track classes to parse,
the metadata-related state as well as for the field injection methods
for tests.

Lastly, this commit increases the test coverage for the provided
annotations and adds integration tests and fixes a few `@TestBean`
issues.
2024-04-10 18:16:43 +02:00
Sébastien Deleuze 246f291f67 Use code includes and tabs in WebSocket documentation
See gh-22171
2024-04-09 12:21:36 +02:00
Sébastien Deleuze cabd1f53df Polishing 2024-04-08 18:03:19 +02:00
Sébastien Deleuze a471aa6a9a Use code includes and tabs in Regexp Pointcuts documentation
See gh-22171
2024-04-08 18:03:10 +02:00
Sébastien Deleuze 515295e205 Use code includes and tabs in AOP documentation
See gh-22171
2024-04-08 16:54:45 +02:00
Sébastien Deleuze 94050b3638 Use code includes and tabs in SpEL documentation
See gh-22171
2024-04-08 11:53:56 +02:00
Sébastien Deleuze 5c8043dcea Use code includes and tabs in date/time format documentation
See gh-22171
2024-04-08 10:32:16 +02:00
Stéphane Nicoll a96f22d5e2 Merge branch '6.1.x' 2024-04-02 15:48:04 +02:00
Stéphane Nicoll a942a6e172 Document behavior of profiles enabled for AOT optimizations
Closes gh-32543
2024-04-02 15:47:43 +02:00
Stéphane Nicoll 7a74e45946 Make use of bean definition overriding more visible
This commit makes the use of bean definition overriding more visible and
prepare for a deprecation of the feature in the next major release.

As of this commit, use of bean definition overriding logs at INFO level.
The previous log level can be restored by setting the
allowBeanDefinitionOverriding flag explicitly on the BeanFactory (or
via the related ApplicationContext).

A number of tests that are using bean overriding on purpose have been
updated to set this flag, which will make them easier to find once we
actually deprecate the feature.

Closes gh-31288
2024-04-02 14:05:12 +02:00
Sébastien Deleuze 8af3eb1aea Polishing
See gh-22171
2024-04-02 13:33:29 +02:00
Sébastien Deleuze bede619e7d Refine `@EnableWebFlux` documentation
This commit refines the documentation related to `@EnableWebFlux` in
order to make it more relevant for modern Boot applications.

See gh-22171
2024-04-02 11:48:12 +02:00
Stéphane Nicoll 81bc586e15 Merge branch '6.1.x' 2024-04-02 09:34:39 +02:00
kexin.an 640b97f33c Polish reference guide
See gh-32557
2024-04-02 09:29:55 +02:00
Sébastien Deleuze 91bb7d8daf Use code includes and tabs in MVC Config documentation
This commit also refines the documentation related to
`@EnableWebMvc` in order to make it more relevant for modern Boot
applications.

See gh-22171
2024-03-29 17:58:01 +01:00
Sam Brannen 218a148898 Document null-safe index operator in SpEL
See gh-29847
2024-03-23 14:56:01 +01:00
Sam Brannen 5698191ba0 Rename listener to CommonCachesTestExecutionListener
See gh-30954
2024-03-20 16:37:22 +01:00
Sam Brannen 7d197972e0 Polishing 2024-03-20 13:05:30 +01:00
Stéphane Nicoll 5a86ab99df Merge branch '6.1.x' 2024-03-20 10:01:56 +01:00
Minsung Oh 0b3a05b463 Fix link to vavr in the reference guide
See gh-32494
2024-03-20 09:48:00 +01:00
Stéphane Nicoll 29d307e211 Clear ApplicationContext cache after a test class completes if necessary
The ApplicationContext has a resource cache that it uses while the
context is being refreshed. Once the refresh phase completes, the
cache is cleared as its content is no longer in use. If beans are
lazily initialized, there is a case where the cache might be filled
again as processing is deferred past the refresh phase.

For those cases, the cache is not cleared. This can be a problem when
running in this mode with a large set of test configurations as the TCF
caches the related contexts.

This commit includes an additional TestExecutionListener to the TCF that
clears the resource cache if necessary once a test class completes. It
is ordered so that it runs after `@DirtiesContext` support as marking
the context as dirty will remove it from the cache and make that extra
step unnecessary.

Closes gh-30954
2024-03-20 09:42:41 +01:00
Sam Brannen 0a715bcab3 Merge branch '6.1.x' 2024-03-19 15:52:12 +01:00
Sam Brannen 09f210f5f7 Polish wording in reference manual 2024-03-19 14:15:19 +01:00
Sébastien Deleuze 871860798e Merge branch '6.1.x' 2024-03-19 11:05:22 +01:00
Sébastien Deleuze 71a117c0fd Document AOT limitations related to Kotlin backticks
Closes gh-32487
2024-03-19 11:03:56 +01:00
Stéphane Nicoll 875037c431 Merge branch '6.1.x' 2024-03-15 08:28:24 +01:00
Stéphane Nicoll dfc1b839f3 Polish "Fix default strategy description of ProblemDetail error codes"
See gh-32446
2024-03-15 08:27:59 +01:00
Linor Dolev 302c24aaa8 Fix default strategy description of ProblemDetail error codes
See gh-32446
2024-03-15 08:02:20 +01:00
Sébastien Deleuze 460ffbc0f6 Use code includes and tabs in mvc-controller/ann.adoc
See gh-22171
2024-03-12 19:18:42 +01:00
Sébastien Deleuze 8a67018e61 Use code includes and tabs in embedded-database-support.adoc
See gh-22171
2024-03-12 17:46:38 +01:00
Sébastien Deleuze 9cc74e78f8 Refine "Redirecting to a resource" section code sample
The commit updates the code sample to use a null element friendly list.

Closes gh-32423
2024-03-12 12:22:37 +01:00
rstoyanchev f9883d8bd6 Polishing contribution
Closes gh-31970
2024-03-12 10:43:31 +00:00
injae-kim 76d00d78db Support splitting STOMP messages in WebSocketStompClient
See gh-31970
2024-03-12 10:43:31 +00:00
Stéphane Nicoll 92d1ebefbb Upgrade to HtmUnit 3.11.0
This commit upgrades to a major new release of HtmlUnit. This is a
breaking change as HtmlUnit 3 moves to a `org.htmlunit` package and
calling code needs to be restructured.

Our use of Selenium has been adapted accordingly, moving to Selenium
3, using the new org.seleniumhq.selenium:htmlunit3-driver integration.

Closes gh-30392
2024-03-11 14:36:46 +01:00
Stéphane Nicoll ffb1caaff4 Polish contribution
See gh-32411
2024-03-11 08:56:59 +01:00
Yanming Zhou 918c5f1f33 Polish Bean Overriding in Tests section of the reference guide
See gh-32411
2024-03-11 08:43:40 +01:00
ZeroCyan 5dc1190930
Fix typo in web documentation
Fixed a small typo.

Closes gh-32407
2024-03-10 16:50:00 +01:00
Juergen Hoeller c1287d48e2 Polishing 2024-03-08 19:31:01 +01:00
rstoyanchev 38d5c0fed6 Add RFC-7807 response interception
Closes gh-31822
2024-03-08 16:56:38 +00:00
Simon Baslé e1bbdf0913 Add support for bean overriding in tests
This commit introduces two sets of annotations (`@TestBean` on one side
and `MockitoBean`/`MockitoSpyBean` on the other side), as well as an
extension mecanism based on the `@BeanOverride` meta-annotation.

Extension implementors are expected to only provide an annotation,
a BeanOverrideProcessor implementation and an OverrideMetadata subclass.

Closes gh-29917.
2024-03-08 16:52:39 +01:00
Sam Brannen 90867e7e62 Merge branch '6.1.x' 2024-03-08 15:50:29 +01:00
Sam Brannen 528029a0ba Document that SpEL expressions using array construction cannot be compiled
Closes gh-32401
2024-03-08 15:49:08 +01:00
Sébastien Deleuze db3c7a157e Use consistently snippet tags
See gh-22171
2024-03-08 12:15:51 +01:00
Sébastien Deleuze d2e55a2038 Use code includes and tabs in jdbc/core.adoc
See gh-22171
2024-03-08 12:15:51 +01:00
Sébastien Deleuze 722199fe6d Use code includes and tabs in connections.adoc
See gh-22171
2024-03-07 17:40:11 +01:00
Juergen Hoeller 4ec4e93ece Document when the JPA infrastructure is ready for use
Closes gh-26153
See gh-21868
2024-03-07 13:35:58 +01:00
Sam Brannen 40da093f58 Polishing 2024-03-06 15:42:14 +01:00
Juergen Hoeller 14a461e795 Consider type-level qualifier annotations for transaction manager selection
Closes gh-24291
2024-03-06 13:36:33 +01:00
Juergen Hoeller 7d4c8a403e Introduce configurable default rollback rules
Includes rollbackOn annotation attribute on @EnableTransactionManagement and addDefaultRollbackRule method on AnnotationTransactionAttributeSource, as well as publicMethodsOnly as instance-level flag (also on AnnotationCacheOperationSource).

Closes gh-23473
2024-03-05 18:08:08 +01:00
Sam Brannen 4a6dbb17f4 Merge branch '6.1.x' 2024-03-03 14:51:01 +01:00
Sam Brannen 380184e85a Support SpEL compilation of #root or #this with non-public type
Prior to this commit, if a Spring Expression Language (SpEL) expression
referenced the root context object via the #root or #this variable, we
inserted a checkcast in the generated byte code that cast the object to
its concrete type. However if the root context object's type was
non-public, that resulted in an IllegalAccessError when the compiled
byte code was executed.

VariableReference.getValueInternal() already contains a solution for
global variables which inserts a checkcast to Object in the generated
byte code instead of to the object's concrete non-public type.

This commit therefore applies the same logic to #root (or #this when
used to reference the root context object) that is already applied to
global variables.

Closes gh-32356
2024-03-03 14:49:42 +01:00
Sam Brannen fdbefad59c Improve documentation for SpEL indexing support
Prior to this commit, the reference manual only documented indexing
support for arrays, lists, and maps.

This commit improves the overall documentation for SpEL's property
navigation and indexing support and introduces additional documentation
for indexing into Strings and Objects.

Closes gh-32355
2024-03-01 18:08:29 +01:00
Sam Brannen 193424c465 Polish "Background Initialization" documentation 2024-03-01 16:14:12 +01:00
Juergen Hoeller 89a10d5c9b Reference documentation for @Bean(bootstrap=BACKGROUND)
See gh-13410
2024-02-29 17:51:31 +01:00
Juergen Hoeller 4ac521607e Reference documentation for @Fallback
See gh-26241
2024-02-29 17:51:12 +01:00
Sébastien Deleuze 570c5b34e6 Merge branch '6.1.x' 2024-02-28 18:35:29 +01:00
Sébastien Deleuze 0de3b30029 Provide guidelines for using Kotlin properties with proxies
A typical use case is `@Scope` and its popular `@RequestScope`
specialization.

Closes gh-32287
2024-02-28 18:33:39 +01:00
Sam Brannen 18dc7d73d6 Merge branch '6.1.x' 2024-02-28 10:42:31 +01:00
Sam Brannen 5830aac1d4 Omit parameter names in REST Clients section of reference docs
For consistency with other examples, this commit omits `method` parameter
names in the "Migrating from RestTemplate to RestClient" section of the
reference docs.

Closes gh-32335
2024-02-28 10:41:50 +01:00
Sam Brannen 0eb61c0f72 Polish REST Clients section 2024-02-28 10:34:57 +01:00
Tadaya Tsuyukubo 5bd1c1fddb Add ThreadLocalAccessor for LocaleContext and RequestAttributes
Add `ThreadLocalAccessor` implementations:
- `LocaleThreadLocalAccessor`
- `RequestAttributesThreadLocalAccessor`

See gh-32243
2024-02-15 15:49:55 +01:00
Stéphane Nicoll e3aa5b6b11 Use new implementation in PropertyPlaceholderHelper
This commit removes the previous implementation in favor of the new
PlaceholderParser. The only noticeable side effect is that the exception
is no longer an IllegalArgumentException, but rather the dedicated
PlaceholderResolutionException.

See gh-9628
2024-02-15 15:27:13 +01:00
Stéphane Nicoll 18ea43c905 Allow customizations of embedded database connections
This commit allows EmbeddedDatabaseConfigurer instances to be further
customized if necessary. EmbeddedDatabaseBuilder has a way now to set
a DatabaseConfigurer rather than just a type to provide full control,
or customize an existing supported database type using the new
EmbeddedDatabaseConfigurers#customizeConfigurer callback.

Closes gh-21160
2024-02-15 13:46:49 +01:00
Cirus Thenter 2284254d39
Fix Kotlin syntax errors in RestClient builder example
Closes gh-32265
2024-02-14 13:52:33 +01:00
Sébastien Deleuze 6e9607ce99 Use double dot in META-INF/aop.xml documentation
Closes gh-32264
2024-02-14 10:42:15 +01:00
Stéphane Nicoll 48da9524c3 Polish 2024-02-14 02:40:02 +01:00
Sam Brannen 68189f3de9 Document that "functions are variables" in SpEL evaluation contexts
Although EvaluationContext defines the API for setting and looking up
variables, the internals of the Spring Expression Language (SpEL)
actually provide explicit support for registering functions as
variables.

This is self-evident in the two registerFunction() variants in
StandardEvaluationContext; however, functions can also be registered as
variables when using the SimpleEvaluationContext.

Since custom functions are also viable in use cases involving the
SimpleEvaluationContext, this commit documents that functions may be
registered in a SimpleEvaluationContext via setVariable().

This commit also explicitly documents the "function as a variable"
behavior in the class-level Javadoc for both StandardEvaluationContext
and SimpleEvaluationContext, as well as in the reference manual.

Closes gh-32258
2024-02-13 17:22:35 +01:00
Sam Brannen 10bc93c058 Polishing 2024-02-13 17:22:35 +01:00
Sébastien Deleuze 8c3fc8c549 Add documentation for functional resource handling
Closes gh-27257
2024-02-13 13:36:48 +01:00
Sam Brannen 4454b3b5ef Polishing 2024-02-13 13:15:51 +01:00
Stéphane Nicoll c46d6286ee Review AOT recommendations in the reference guide
This commit focuses on improving the AOT section on programmatic
registration of additional beans. This makes it more clear that a
`BeanDefinitionRegistry` must be used and that singletons are not
processed.

Closes gh-32240
Closes gh-32241
2024-02-12 16:48:26 +01:00