Commit Graph

31739 Commits

Author SHA1 Message Date
Juergen Hoeller 5e549da75f Use Log4j 3.0.0 beta 3 for testing
See gh-32459
2024-12-12 19:15:27 +01:00
Juergen Hoeller 3db1b94465 Replace spring-jcl with regular Apache Commons Logging 1.3
Closes gh-32459
2024-12-12 17:37:11 +01:00
Stéphane Nicoll c5eefaa5f3 Merge branch '6.2.x' 2024-12-12 17:35:59 +01:00
Stéphane Nicoll d7a3971403 Merge pull request #34077 from scordio
* pr/34077:
  Polish "Prevent execution of Antora jobs on forks"
  Prevent execution of Antora jobs on forks

Closes gh-34077
2024-12-12 17:35:51 +01:00
Stéphane Nicoll cfa3463cec Polish "Prevent execution of Antora jobs on forks"
See gh-34077
2024-12-12 17:35:38 +01:00
Stefano Cordio d2264b221a Prevent execution of Antora jobs on forks
See gh-34077
2024-12-12 17:34:15 +01:00
Stéphane Nicoll 7a6ba43402 Merge branch '6.2.x' 2024-12-12 17:32:50 +01:00
Stéphane Nicoll 2c32601553 Add note about using @EventListener on lazy beans
Closes gh-34057
2024-12-12 17:32:18 +01:00
Sam Brannen 01a15cf0e7 Merge branch '6.2.x' 2024-12-12 14:41:51 +01:00
Sam Brannen ea8b18fbc7 Polish Javadoc for BeanOverrideHandler 2024-12-12 14:41:23 +01:00
Brian Clozel 0ebbe024f2 Merge branch '6.2.x' 2024-12-12 10:54:05 +01:00
Brian Clozel 3ab4ee2bba Next development version (v6.2.2-SNAPSHOT) 2024-12-12 10:53:14 +01:00
Juergen Hoeller 429833cae6 Merge branch '6.2.x'
# Conflicts:
#	spring-web/src/main/java/org/springframework/http/client/SimpleClientHttpRequestFactory.java
2024-12-11 17:55:36 +01:00
Juergen Hoeller 0aa721cad0 Polishing 2024-12-11 17:52:59 +01:00
Juergen Hoeller 63af572ce8 Upgrade to Jackson 2.18.2, RxJava 3.1.10, Checkstyle 10.20.2 2024-12-11 17:34:53 +01:00
Juergen Hoeller 72c2343f63 Avoid deprecated ListenableFuture name for internal class 2024-12-11 17:34:48 +01:00
rstoyanchev 2d5943352f Merge branch '6.2.x' 2024-12-11 16:22:47 +00:00
rstoyanchev 8aeced9f80 Support header filtering in web data binding
Closes gh-34039
2024-12-11 16:11:22 +00:00
rstoyanchev 70c326ed30 Support headers in DataBinding via constructor args
Closes gh-34073
2024-12-11 16:10:08 +00:00
rstoyanchev 7b4e19c69b Make ExtendedServletRequestDataBinder public
Make it public and move it down to the annotations package alongside
InitBinderBindingContext. This is mirrors the hierarchy in Spring MVC
with the ExtendedServletRequestDataBinder. The change will allow
customization of the header names to include/exclude in data binding.

See gh-34039
2024-12-11 16:09:56 +00:00
rstoyanchev 3b95d2c449 Support Flux<ServerSentEvent<Fragment>> in WebFlux
Closes gh-33975
2024-12-11 16:09:38 +00:00
rstoyanchev 640e570583 Minor refactoring in ServerSentEvent
Extract re-usable method to serialize SSE fields.

See gh-33975
2024-12-11 16:09:22 +00:00
rstoyanchev 66f33a8265 MapMethodProcessor supportsParameter is more specific
Closes gh-33160
2024-12-11 16:09:01 +00:00
Juergen Hoeller 9fe69e2cc4 Merge branch '6.2.x' 2024-12-11 16:59:31 +01:00
Juergen Hoeller 68997d8416 Avoid javadoc references to deprecated types/methods 2024-12-11 16:58:37 +01:00
Juergen Hoeller cb633832a9 Remove unused HibernateCallback interface
See gh-33750
2024-12-11 16:48:12 +01:00
Brian Clozel 88a5b4efd3 Merge branch '6.2.x' 2024-12-11 16:12:01 +01:00
Brian Clozel 52006b71bc Support Servlet error message in MockMvc assertions
Prior to this commit, `MockMvc` would support checking for the Servlet
error message as the "response status reason". While this error message
can be driven with the `@ResponseStatus` annotation, this message is not
technically the HTTP status reason listed on the response status line.

This message is provided by the Servlet container in the error page when
the `response.sendError(int, String)` method is used.

This commit adds the missing
`mvc.get().uri("/error/message")).hasErrorMessage("error message")`
assertion to check for this Servlet error message.

Closes gh-34016
2024-12-11 16:00:41 +01:00
Sam Brannen 1ef7e70950 Merge branch '6.2.x' 2024-12-11 15:04:43 +01:00
Sam Brannen 41d9f21ab9 Log alias removal in DefaultListableBeanFactory
Prior to this commit, information was logged when a bean definition
overrode an existing bean definition, but nothing was logged when the
registration of a bean definition resulted in the removal of an alias.

With this commit, an INFO message is now logged whenever an alias is
removed in DefaultListableBeanFactory.

Closes gh-34070
2024-12-11 15:03:52 +01:00
rstoyanchev d45e6ec197 Support Flux<ServerSentEvent<Fragment>> in WebFlux
Closes gh-33975
2024-12-11 12:22:56 +00:00
rstoyanchev c4b100ac0c Minor refactoring in ServerSentEvent
Extract re-usable method to serialize SSE fields.

See gh-33975
2024-12-11 12:22:56 +00:00
rstoyanchev fd8823819f MapMethodProcessor supportsParameter is more specific
Closes gh-33160
2024-12-11 12:22:56 +00:00
Sam Brannen 3256bf436a Merge branch '6.2.x' 2024-12-11 12:12:57 +01:00
Sam Brannen 7206b28272 Implement toString() in TestBeanOverrideHandler
Closes gh-34072
2024-12-11 12:12:35 +01:00
Brian Clozel 11db31a8ee Merge branch '6.2.x' 2024-12-10 22:36:01 +01:00
Brian Clozel 0c688742e1 Fix custom scheduler support for @Scheduled methods
This commit fixes a regression introduced by gh-24560, when adding
execution metadata support for scheduled tasks. The
`OutcomeTrackingRunnable` would delegate to the actual runnable but
could also hide whether it implements the `SchedulingAwareRunnable`
contract.

This commit ensures that `OutcomeTrackingRunnable` always implements
that contract and delegates to the runnable if possible, or return
default values otherwise.

Fixes gh-34058
2024-12-10 22:33:20 +01:00
Juergen Hoeller 41f8ac6b59 Merge branch '6.2.x' 2024-12-10 22:16:46 +01:00
Juergen Hoeller 7de1dc826a Consistently handle generics in TypeDescriptor.equals
Properly processes recursive types through always comparing generics via the top-level ResolvableType (rather than through nested TypeDescriptors with custom ResolvableType instances).

Closes gh-33932
2024-12-10 22:16:10 +01:00
Juergen Hoeller 3d19d78461 Merge branch '6.2.x' 2024-12-10 16:26:56 +01:00
Juergen Hoeller 3e3ca74020 Log provider setup failure at info level without stacktrace
Closes gh-33979
2024-12-10 16:25:57 +01:00
Juergen Hoeller 66da5d7ab9 Restore original override behavior when override allowed
Closes gh-33920
2024-12-10 16:25:49 +01:00
Stéphane Nicoll 1c435c0f47 Merge branch '6.2.x' 2024-12-10 14:09:18 +01:00
Stéphane Nicoll 68d6cb9d35 Upgrade to Reactor 2024.0.1
Closes gh-34051
2024-12-10 14:06:07 +01:00
Stéphane Nicoll 6649a6e0f7 Upgrade to Micrometer 1.14.2
Closes gh-34050
2024-12-10 14:05:43 +01:00
Sam Brannen 2d4baec2b1 Merge branch '6.2.x' 2024-12-10 12:52:32 +01:00
Sam Brannen 54948a4e88 Log warning when one Bean Override overrides another Bean Override
It is currently possible for one Bean Override to override another
logically equivalent Bean Override.

For example, a @⁠TestBean can override a @⁠MockitoBean, and vice versa.

In fact, it's also possible for a @⁠MockitoBean to override another
@⁠MockitoBean, for a @⁠TestBean to override a @⁠TestBean, etc.

However, there may be viable use cases for one override overriding
another override. For example, one may have a need to spy on a bean
created by a @⁠TestBean factory method.

In light of that, we do not prohibit one Bean Override from overriding
another Bean Override; however, with this commit we now log a warning
to help developers diagnose issues in case such an override is
unintentional.

For example, given the following test class, where TestConfig registers
a single bean of type MyService named "myService"...

@⁠SpringJUnitConfig(TestConfig.class)
class MyTests {

  @⁠TestBean(methodName = "example.TestUtils#createMyService")
  MyService testService;

  @⁠MockitoBean
  MyService mockService;

  @⁠Test
  void test() {
    // ...
  }
}

... running that test class results in a log message similar to the
following, which has been formatted for readability.

WARN - Bean with name 'myService' was overridden by multiple handlers:
[
 [TestBeanOverrideHandler@44b21f9f
  field = example.MyService example.MyTests.testService,
  beanType = example.MyService,
  beanName = [null],
  strategy = REPLACE_OR_CREATE
 ],
 [MockitoBeanOverrideHandler@7ee8130e
  field = example.MyService example.MyTests.mockService,
  beanType = example.MyService,
  beanName = [null],
  strategy = REPLACE_OR_CREATE,
  reset = AFTER,
  extraInterfaces = set[[empty]],
  answers = RETURNS_DEFAULTS, serializable = false
 ]
]

NOTE: The last registered BeanOverrideHandler wins. In the above
example, that means that @⁠MockitoBean overrides @⁠TestBean, resulting
in a Mockito mock for the MyService bean in the test's
ApplicationContext.

Closes gh-34056
2024-12-10 12:49:48 +01:00
Sébastien Deleuze 83517d05d0 Merge branch '6.2.x' 2024-12-10 11:51:19 +01:00
Sébastien Deleuze a00ba8dbcf Revert "Reuse NoTransactionInContextException instances"
This reverts commit 8e3846991d.

Closes gh-34048
2024-12-10 11:47:56 +01:00
Stéphane Nicoll 2546f63824 Merge branch '6.2.x' 2024-12-10 07:48:01 +01:00