Commit Graph

31215 Commits

Author SHA1 Message Date
Sam Brannen
e1c450d253 Support Bean Overrides with AOT and native image
This set of commits introduces AOT and native image support for the new
Bean Override feature in the Spring TestContext Framework -- for
example, for using @⁠TestBean and @⁠MockitoBean in AOT mode on the JVM
as well as in a GraalVM native image.

Note, however, that @⁠MockitoBean has currently only been tested in a
native image when mocking interfaces and using Mockito's
ProxyMockMaker, along with a custom runtime hints.

Closes gh-32933
2024-10-08 17:57:21 +02:00
Sam Brannen
65d219131c Stop disabling MockitoResetTestExecutionListener within a native image
Instead, MockitoResetTestExecutionListener is now only enabled if the
current test class uses Mockito annotations or Mockito-related
annotations in spring-test.

See gh-32933
2024-10-08 17:41:30 +02:00
Sam Brannen
9a4be95dee Verify registration of runtime hints for Bean Overrides
See gh-32933
2024-10-08 17:41:30 +02:00
Sam Brannen
6a2e234a87 Register runtime hints for BeanOverrideProcessors
This commit introduces a BeanOverrideReflectiveProcessor which
registers runtime hints for any BeanOverrideProcessor configured
via @⁠BeanOverride.

See gh-32933
2024-10-08 17:41:17 +02:00
Sam Brannen
5ddeb06640 Skip pseudo bean definition registration during AOT processing
Prior to this commit, AOT processing failed for tests that made use of
the Bean Override feature to "override" a nonexistent bean. The reason
is that we register a "pseudo" bean definition as a placeholder for a
nonexistent bean, and our AOT support cannot automatically convert that
"pseudo" bean definition to a functional bean definition for use at AOT
runtime.

To address that, this commit skips registration of "pseudo" bean
definitions during AOT processing, and by doing so we enable the JVM
runtime and AOT runtime to operate with the same semantics.

See gh-32933
2024-10-08 17:41:11 +02:00
Sam Brannen
ce8e06cf10 Register Bean Override infrastructure beans as manual singletons
Prior to this commit, AOT processing failed for tests that made use of
the Bean Override feature, since the Set<OverrideMetadata> constructor
argument configured in the bean definition for the
BeanOverrideBeanFactoryPostProcessor cannot be properly processed by
our AOT support. The reason is that each OverrideMetadata instance is
effectively an arbitrary object graph that cannot be automatically
converted to a functional bean definition for use at AOT runtime.

To address that, this commit registers Bean Override infrastructure
beans as manual singletons instead of via bean definitions with the
infrastructure role.

See gh-32933
2024-10-08 16:58:59 +02:00
Juergen Hoeller
f590511112 Introspect pre-registered singletons in preDetermineBeanTypes as well
Closes gh-33668
2024-10-08 16:50:12 +02:00
rstoyanchev
c4b6a02091 Polishing contribution
Closes gh-33594
2024-10-08 13:32:33 +01:00
Johnny Lim
1ec9a115a8 Replace RFC 7807 with RFC 9457 in documentation
See gh-33594
2024-10-08 13:32:33 +01:00
Brian Clozel
3303c98650 Fix link to code of conduct
Closes gh-33663
2024-10-08 14:03:54 +02:00
rstoyanchev
000b8a699c Auto-detect Reactor Netty client in RestClient
Closes gh-33635
2024-10-08 10:56:43 +01:00
rstoyanchev
a84a41fa43 Polishing contribution
Closes gh-33638
2024-10-08 10:56:42 +01:00
Dariusz Jędrzejczyk
a78385f8e5 Handle X-Forwarded-Prefix parsed by Reactor Netty
See gh-33638
2024-10-08 10:56:42 +01:00
Juergen Hoeller
f9f025df43 Add note on autowireCandidate versus defaultCandidate
Closes gh-33392
2024-10-08 11:36:39 +02:00
Juergen Hoeller
1eee795143 Merge branch '6.1.x' 2024-10-08 11:34:27 +02:00
Juergen Hoeller
2622db1dbe Consistent references to annotation-based autowiring 2024-10-08 11:26:42 +02:00
rstoyanchev
b13f86cf46 Fix failing tests in spring-test after recent changes
See gh-33639
2024-10-07 21:09:10 +01:00
rstoyanchev
2389748e25 Parameterize URI parsing tests
Closes gh-33639
2024-10-07 18:35:03 +01:00
rstoyanchev
d6fcad9ad7 Add logging to RfcUriParser
See gh-33639
2024-10-07 18:35:03 +01:00
rstoyanchev
ef0a21ec7a Update documentation for URI parsing types
See gh-33639
2024-10-07 18:35:03 +01:00
rstoyanchev
6c62965cbb Remove regular expressions from UriComponentsBuilder
See gh-33639
2024-10-07 18:35:03 +01:00
rstoyanchev
bbb53d03c4 Pluggable URI parsing, use RFC parser by default
See gh-33639
2024-10-07 18:35:03 +01:00
rstoyanchev
52805da733 Add URI parser based on syntax in RFC 3986
See gh-33639
2024-10-07 18:35:03 +01:00
rstoyanchev
10f45223aa Rename UrlParser to WhatWgUrlParser
See gh-33639
2024-10-07 18:35:03 +01:00
rstoyanchev
6ba3bb54a0 Add efficient isUnreservedOrSubDelimiter method
isUnreserved and isSubDelimiter are usually checked together. It helps
to have a shortcut with an efficient lookup.

See gh-33639
2024-10-07 18:35:03 +01:00
rstoyanchev
e04b115a7e Remove test for IPv4 compatible IPv6 address
An example of this can be found in RFC 2732, but it is obsoleted by
RFC 3986 whose syntax for IPv6address does not allow dots.

Also, Appendix D of RFC 3986:

As [RFC2732] defers to [RFC3513] for definition of an IPv6 literal
address, which, unfortunately, lacks an ABNF description of
IPv6address, we created a new ABNF rule for IPv6address that matches
the text representations defined by Section 2.2 of [RFC3513].

See gh-33639
2024-10-07 18:35:03 +01:00
rstoyanchev
92308ac83f Polishing in UrlParser 2024-10-07 18:35:02 +01:00
Sam Brannen
98bee41630 Polish BeanOverrideBeanFactoryPostProcessor 2024-10-07 14:22:53 +02:00
Juergen Hoeller
c10a7f300c Merge branch '6.1.x' 2024-10-07 10:20:38 +02:00
Juergen Hoeller
3dac274d20 Avoid synchronization for delegate initialization
Closes gh-33656
2024-10-07 10:19:16 +02:00
Khyojun
f86bc1cbe8 Polish CorsConfiguration
Closes gh-33650
2024-10-07 09:11:36 +02:00
KimJuHyun
f1cbbd2aa8 Remove redundant array length check
Closes gh-33655
2024-10-07 08:24:37 +02:00
Stéphane Nicoll
c73e76cf2e Merge branch '6.1.x' 2024-10-07 08:06:50 +02:00
Stéphane Nicoll
6b975592bf Harmonize GitHub Actions structure
See https://github.com/spring-projects/spring-boot/issues/42512
2024-10-07 07:57:16 +02:00
Sam Brannen
ad4f0c99bf Polish StringUtilsTests 2024-10-06 15:36:16 +02:00
zinzo
2cd1ee8a24 Add unit tests for StringUtils.hasLength()
Closes gh-33658
2024-10-06 15:28:41 +02:00
Johnny Lim
1016743fc3 Remove Javadoc @⁠since tag from MapAccessor default constructor
See gh-33222
Closes gh-33659
2024-10-06 15:18:48 +02:00
Sam Brannen
28b9cf3b83 Simplify and document BeanOverrideTestExecutionListener
This commit simplifies the implementation of
BeanOverrideTestExecutionListener by introducing a static
injectFields() utility method and removing the use of BiConsumers,
records, and duplicated code.

This commit also introduces Javadoc for all methods in
BeanOverrideTestExecutionListener.

Closes gh-33660
2024-10-06 15:05:10 +02:00
Sam Brannen
b0c7d15d9f Polishing 2024-10-05 13:57:24 +02:00
Park Sung Jun
32df079b05 Polish use of constants in StringUtils
The hardcoded '.' and '\\' literals have been replaced by the use of
EXTENSION_SEPARATOR and WINDOWS_FOLDER_SEPARATOR_CHAR.

Closes gh-33654
2024-10-05 13:57:24 +02:00
Sam Brannen
d89983d633 Upgrade to Mockito 5.14.1 2024-10-04 17:24:55 +02:00
Sam Brannen
d957d01d14 Polishing 2024-10-04 15:48:26 +02:00
Sam Brannen
c4c005b82e Emulate AbstractAotProcessor.process() in AOT endToEndTests() 2024-10-04 15:46:23 +02:00
Sam Brannen
21d80dd849 Upgrade to JUnit 5.11.2 2024-10-04 15:39:00 +02:00
Sam Brannen
b7f394c2a1 Merge branch '6.1.x' 2024-10-04 15:36:51 +02:00
Sam Brannen
c44e43d791 Upgrade to JUnit 5.10.5 2024-10-04 15:33:25 +02:00
Sam Brannen
2569aa157e Make use of Executable abstraction in ProxyRuntimeHintsRegistrar 2024-10-04 15:05:37 +02:00
Sam Brannen
911d1b03cd Polishing 2024-10-04 15:05:37 +02:00
Sam Brannen
fb5e4c0ef2 Remove obsolete method parameter 2024-10-04 11:16:49 +02:00
Stéphane Nicoll
beca562ac2 Merge branch '6.1.x' 2024-10-04 10:20:28 +02:00