Commit Graph

32062 Commits

Author SHA1 Message Date
Sam Brannen
021bf6e77d Add more tests for escape character support in PlaceholderParser 2025-05-10 14:19:41 +02:00
Sam Brannen
90453643cc Simplify and revise PlaceholderParserTests for consistency 2025-05-10 14:16:49 +02:00
Sam Brannen
5a2cbc1ab3 Polish PropertySourcesPropertyResolverTests 2025-05-09 16:43:04 +02:00
Sam Brannen
348b4cd067 Polish contribution
See gh-34720
2025-05-09 16:32:13 +02:00
Fawzi Essam
9b52cfd7d5 Test escape character support in PropertySourcesPropertyResolver
See gh-34326
See gh-34720
See gh-34861

Signed-off-by: Fawzi Essam <iifawzie@gmail.com>
2025-05-09 16:31:27 +02:00
Sam Brannen
dd6eede243 Properly expand reused collection parameters in R2DBC NamedParameterUtils
Prior to this commit, NamedParameterUtils in spring-r2dbc did not
properly expand reused collection parameters. Specifically, values in a
supplied collection were only expanded in the resulting query once, for
the first occurrence of the named parameter.

To address that, this commit effectively reinstates the original logic
for ExpandedQuery from NamedParameterUtils in the Spring Data R2DBC
project.

94958f5eb6/spring-data-r2dbc/src/main/java/org/springframework/data/r2dbc/core/NamedParameterUtils.java (L486)

Closes gh-34768
2025-05-09 14:27:19 +02:00
Sam Brannen
de97e35189 Polish Javadoc and internals of R2DBC support 2025-05-09 14:04:10 +02:00
Sam Brannen
45a2c51fe1 Polish Javadoc for Environment-related components 2025-05-08 10:49:44 +02:00
Sam Brannen
b98c3257af Introduce @⁠Disabled failing test for R2DBC NamedParameterUtils
The last assertion of the new test method currently fails since "foo"
is only bound once.

java.lang.AssertionError:
Expected size: 2 but was: 1 in:
{0="foo"}

See gh-34768
2025-05-07 17:30:07 +02:00
Sam Brannen
ea8ae09cb7 Revise NamedParameterUtilsTests for consistency 2025-05-07 17:24:41 +02:00
Sam Brannen
0abfad870c Polish class-level Javadoc for SpringProperties 2025-05-07 16:14:23 +02:00
Sam Brannen
5a9af9e024 Document AotDetector.AOT_ENABLED flag in SpringProperties
Prior to this commit, the AotDetector.AOT_ENABLED flag was documented
in the reference manual not in the Javadoc for SpringProperties.
2025-05-07 16:14:07 +02:00
Sam Brannen
0867dfca33 Introduce CompositePropertySource constructor that accepts Iterable<PropertySource>
This commit introduces a new constructor for CompositePropertySource
that accepts a `String name` and an Iterable<PropertySource<?>>, which
allows a CompositePropertySource to be constructed from existing
property sources, such as an instance of MutablePropertySources.

Closes gh-34862
2025-05-07 14:25:13 +02:00
Sam Brannen
b4355dc955 Polishing 2025-05-07 12:42:40 +02:00
Sam Brannen
bc91e0ea96 Revise PropertyResolver Javadoc to highlight resolution semantics 2025-05-06 18:50:33 +02:00
Sam Brannen
8599ee6c2b Polish Javadoc 2025-05-06 16:07:46 +02:00
Sam Brannen
bc466022b1 Fix typo in parameter name 2025-05-06 16:07:46 +02:00
Brian Clozel
6f11711e27 Fix HttpClient 5.3.x request config compatibility
As of gh-33806, the HttpComponents client request factory is forward
compatible with the 5.4+ versions of that library for configuring HTTP
request configuration.

This change would not tkae into account configuration set at the Spring
level because it would consider the default `RequestConfig` instance as
a custom one. This commit ensures that Spring sets its own configuration
if no custom configuration was set for all supported HttpComponents
generations.

Fixes gh-34851
2025-05-05 14:38:30 +02:00
rstoyanchev
c067919173 Ensure Fragment can merge attributes
Use a new map when merging as the original may be immutable.

Closes gh-34848
2025-05-02 15:58:51 +01:00
rstoyanchev
ac773d97e9 Polishing contribution
Closes gh-34828
2025-05-02 15:58:51 +01:00
Artur
bd7007227c Provide a working example instead of unclear placeholders
See gh-34828

Signed-off-by: Artur <artur@vaadin.com>
2025-05-02 15:58:51 +01:00
Sam Brannen
e8f873a349 Ensure Bean Overrides are discovered once in hierarchies
Prior to this commit, bean overrides (such as @⁠MockitoBean, etc.) were
discovered multiple times if they were declared:

- at the type-level on an interface that is implemented at more than
  one level in the type hierarchy, the enclosing class hierarchy, or a
  combination of the type and enclosing class hierarchies.

or

- on a field declared in a class which can be reached multiple times
  while traversing the type and enclosing class hierarchies in
  scenarios such as the following: the class (X) in which the field is
  declared is a supertype of an enclosing type of the test class, and X
  is also an enclosing type of a supertype of the test class.

Such scenarios resulted in an IllegalStateException stating that a
duplicate BeanOverrideHandler was discovered.

To address that, this commit revises the search algorithm in
BeanOverrideHandler so that all types (superclasses, enclosing classes,
and implemented interfaces) are only visited once while traversing the
type and enclosing class hierarchies in search of bean override
handlers.

See gh-33925
See gh-34324
Closes gh-34844
2025-05-02 11:26:33 +02:00
Sam Brannen
b943817f3e Close ApplicationContext after test AOT processing
See commit 1c108054ee
Closes gh-34841
2025-05-01 10:50:38 +02:00
Juergen Hoeller
4466548f53 Align parameter javadoc with nullable signature
Closes gh-34845
2025-04-30 17:55:39 +02:00
Juergen Hoeller
9c183f9e77 Add explicit note on redeclaring in each application context
Closes gh-34843
2025-04-30 17:55:18 +02:00
Juergen Hoeller
03620fc530 Polishing 2025-04-29 11:47:47 +02:00
Juergen Hoeller
1c108054ee Close ApplicationContext after AOT processing
Closes gh-34841
2025-04-29 11:47:09 +02:00
Juergen Hoeller
d0b186a1c7 Polishing 2025-04-28 16:13:04 +02:00
Juergen Hoeller
4172581f1b Try loadClass on LinkageError in case of same ClassLoader as well
Closes gh-34824
2025-04-28 16:12:45 +02:00
rstoyanchev
c88ba6c90e Polishing contribution
Closes gh-34812
2025-04-28 14:23:30 +01:00
Yanming Zhou
d7c13d6518 HttpEntity.EMPTY should be immutable
See gh-34812

Signed-off-by: Yanming Zhou <zhouyanming@gmail.com>
2025-04-28 14:22:59 +01:00
Sam Brannen
5013d6d771 Fail Gradle build whenever a javadoc task fails
To ensure that failures in javadoc tasks do not result in documentation
silently not being generated/published, this commit sets
`failOnError = true` for all javadoc tasks.

See gh-27497
See gh-34774
Closes gh-34837
2025-04-27 17:59:41 +02:00
Sam Brannen
9cd7b6a91e Upgrade spring-javaformat-gradle-plugin to version 0.0.43 2025-04-27 16:51:47 +02:00
Sam Brannen
e9dcd64068 Upgrade to Gradle 8.14
Closes gh-34836
2025-04-27 16:29:46 +02:00
Sam Brannen
ce7f47c962 Upgrade io.freefair.aggregate-javadoc plugin to version 8.13.1 2025-04-27 16:23:22 +02:00
Sam Brannen
ef34464c94 Restructure TestContext framework support sections
This commit moves the JUnit Jupiter section above the JUnit 4 section
and groups all JUnit 4 sections under a new "JUnit 4 Support" heading.
2025-04-26 09:38:10 +02:00
Sam Brannen
ef11a00c0b Polishing 2025-04-26 09:37:34 +02:00
Sam Brannen
176b0b09bf Migrate remaining JUnit 4 tests to JUnit Jupiter where feasible
In 49e5c84928 I unfortunately overlooked
several JUnit 4 based tests in the `junit4` package that should be
migrated to JUnit Jupiter.

This commit address those remaining test classes.

See gh-23451
See gh-34794
Closes gh-34813
2025-04-26 07:51:24 +02:00
rstoyanchev
c48ff357dc HTTP Service proxy sets body type
Closes gh-34793
2025-04-25 21:03:00 +01:00
rstoyanchev
190dabb8e1 Polishing contribution
Closes gh-34789
2025-04-25 21:03:00 +01:00
blake_bauman
d15abd58b4 Add option to set Principal in MockServerWebExchange
See gh-34789

Signed-off-by: blake_bauman <blake_bauman@apple.com>
2025-04-25 21:03:00 +01:00
Sam Brannen
44500cf868 Revise TestConventions to retain existing JUnit Platform options
This commit revises the implementation of TestConventions so that
existing JUnit Platform options from a pre-configured `test` task are
copied instead of overridden.

Closes gh-34827
2025-04-25 13:38:18 +02:00
Sam Brannen
e384389790 Reinstate the @⁠Inject Technology Compatibility Kit (TCK)
In commit 05ebca8677, the `public` modifier was removed from the
SpringAtInjectTckTests class, which prevents it from being run as a
JUnit 3 test class.

To address that, this commit adds the missing `public` modifier as well
as a a code comment to help prevent this from happening again.

In addition, this commit updates spring-context.gradle to ensure that
the JUnit Vintage test engine is always applied. However, that Gradle
configuration is unfortunately ignored due to how our TestConventions
class has been implemented. Thus, that issue will have to be addressed
separately.

Closes gh-34800
2025-04-25 12:08:39 +02:00
Sam Brannen
49e5c84928 Migrate remaining JUnit 4 tests to JUnit Jupiter where feasible
In Spring Framework 5.2, we migrated most of the test suite from JUnit
4 to JUnit Jupiter; however, prior to this commit, several tests in the
spring-test module were still based on JUnit 4 unnecessarily.

Since we are now planning to deprecate our JUnit 4 support in 7.0, this
commit migrates our remaining JUnit 4 based tests to JUnit Jupiter
whenever feasible. In the process, test classes that previously resided
under the "junit4" package have been moved to new packages directly
under the "org.springframework.text.context" package, and several
classes have been renamed for greater clarity of purpose.

Consequently, the only remaining tests based on JUnit 4 are those tests
that are required to run with JUnit 4 in order to test our JUnit 4
support.

This commit also greatly simplifies exclusions for Checkstyle rules
pertaining to JUnit usage.

See gh-23451
See gh-34794
Closes gh-34813
2025-04-24 16:20:39 +02:00
Sébastien Deleuze
56eb135608 Fix AbstractJackson2HttpMessageConverter nullness
This commit makes AbstractJackson2HttpMessageConverter#getObjectMappersForType
return value non nullable as an empty map is returned in case of no
registrations.

Closes gh-34811
2025-04-24 10:37:30 +02:00
rstoyanchev
5c5cf73e11 Add ignoreCase variants to PatternMatchUtils
See gh-34801
2025-04-23 12:10:55 +01:00
rstoyanchev
858c2bd270 Polishing contribution
Closes gh-34783
2025-04-23 10:54:52 +01:00
whl
124582d910 Fix expansion of query param with same name
See gh-34783

Signed-off-by: whl <whlit.cola@gmail.com>
2025-04-23 10:54:52 +01:00
Juergen Hoeller
253f321e8b Early getJarFile() call for consistent jar file existence check
See gh-34796
2025-04-23 10:16:12 +02:00
Juergen Hoeller
0252e39409 Check for the existence of any actual jar entries in case of jar root
Closes gh-34796
2025-04-22 23:18:56 +02:00