Commit Graph

24702 Commits

Author SHA1 Message Date
Stephane Nicoll 60d2d16b2b Polish 2022-07-26 15:18:35 +02:00
Stephane Nicoll ebe3b37298 Allow MergedBeanDefinitionPostProcessor to handle bean creation
This commit registers the MergedBeanDefinitionPostProcessor instances
on the BeanFactory processed for AOT purposes. This allows beans that
are created at build-time to be post-processed for low-level needs such
as initialization and autowiring.

Closes gh-28777
2022-07-26 09:25:11 +02:00
Stephane Nicoll 9573fc96ec Polish 2022-07-25 13:45:46 +02:00
Stephane Nicoll 75c63f877b Merge branch '5.3.x' 2022-07-25 13:33:06 +02:00
Stephane Nicoll 95a400abfb Merge pull request #28867 from arvyy
* pr/28867:
  Add missing closing parenthesis

Closes gh-28867
2022-07-25 13:32:13 +02:00
arvyy 4383a673bb Add missing closing parenthesis
See gh-28867
2022-07-25 13:30:45 +02:00
Arjen Poutsma 1bce274099 Merge branch '5.3.x' 2022-07-25 12:24:16 +02:00
Arjen Poutsma f7b94fc3e8 Updated sdkmanrc 2022-07-25 12:21:58 +02:00
Stephane Nicoll ae6a464a80 Merge branch '5.3.x' 2022-07-22 16:15:55 +02:00
Stephane Nicoll 93760d1211 Merge pull request #28853 from marcwrobel
* pr/28853:
  Polish "Deprecate SockJsServiceRegistration#setSupressCors"
  Deprecate SockJsServiceRegistration#setSupressCors

Closes gh-28853
2022-07-22 16:15:05 +02:00
Stephane Nicoll 421b5cb311 Polish "Deprecate SockJsServiceRegistration#setSupressCors"
See gh-28853
2022-07-22 16:07:47 +02:00
Marc Wrobel 1cc36e5be9 Deprecate SockJsServiceRegistration#setSupressCors
SockJsServiceRegistration#setSupressCors name contains a typo. It is
now deprecated in favor of a correctly spelled method, setSuppressCors.

See gh-28853
2022-07-22 16:06:54 +02:00
Stephane Nicoll c1738aab0d Improve target detection for FactoryBeans with generic
Closes gh-28809
2022-07-22 13:10:44 +02:00
Stephane Nicoll bbcc269487 Polish 2022-07-22 12:09:16 +02:00
Stephane Nicoll c09eb633db Rename test fixture to avoid class with existing TestBean class 2022-07-22 12:03:00 +02:00
Stephane Nicoll ba5ab1ad9d Polish 2022-07-22 09:36:45 +02:00
Phillip Webb cfb61d2a17 Add generics to BeanInstanceSupplier
Update `BeanInstanceSupplier` to support a generic type.

See gh-28748
2022-07-21 13:29:15 +01:00
Phillip Webb 069d6d3280 Propagate getFactoryMethod() when using InstanceSupplier.andThen()
Update `InstanceSupplier.andThen` to propagate the result of
`getFactoryMethod()`.

See gh-28748
2022-07-20 18:56:57 +01:00
Phillip Webb 3ae1b9ba57 Polish CodeBlock joining logic
Consistently use `CodeBlock.joining(", ")` when generating code.
2022-07-20 10:25:45 +01:00
Stephane Nicoll 4560313b9d Merge pull request #28843 from OlgaMaciaszek
* pr/28843:
  Polish "Handle inferred init/destroy method consistently"
  Handle inferred init/destroy method consistently

Closes gh-28843
2022-07-20 10:46:47 +02:00
Stephane Nicoll 85173b5de3 Polish "Handle inferred init/destroy method consistently"
See gh-28843
2022-07-20 10:45:51 +02:00
Olga Maciaszek-Sharma 68e28a5f59 Handle inferred init/destroy method consistently
See gh-28843
2022-07-20 10:40:51 +02:00
Stephane Nicoll d6345db7c9 Use target of the FactoryBean only if the FactoryBean is public
This commit polishes 85d4a79 so that the target type of factory bean
is only considered if the FactoryBean is accessible. If the FactoryBean
requires protected access, we still generate the code in the package of
the FactoryBean.

Those two commits combined are actually providing a fix for the use
case described in gh-28809.

Closes gh-28809
2022-07-19 21:02:24 +02:00
Stephane Nicoll 978cdfff46 Formatting 2022-07-19 17:57:28 +02:00
Stephane Nicoll 1acb41ff43 Add AOT support for by-type RuntimeBeanReference
Closes gh-28841
2022-07-19 17:57:12 +02:00
Stephane Nicoll cd4f4d978d Merge branch '5.3.x' 2022-07-19 15:39:44 +02:00
Stephane Nicoll f7c32d3a0b Merge pull request #28842 from adrianbob
* pr/28842:
  Reintroduce Javadoc links to Apache HttpClient 5.1 APIs

Closes gh-28842
2022-07-19 15:39:36 +02:00
Adrian Bob 9c0a2eeeb2 Reintroduce Javadoc links to Apache HttpClient 5.1 APIs
See gh-28842
2022-07-19 15:39:18 +02:00
Stephane Nicoll 85d4a79cdc Improve location of generated bean definitions of FactoryBeans
This commit improves the location of generated bean definitions for
FactoryBean implementations by checking the type that the factory
bean generates, rather than the factory bean implementation itself.

Closes gh-28812
2022-07-19 15:17:31 +02:00
Sébastien Deleuze c0bea373a2 Merge branch '5.3.x' 2022-07-19 10:19:00 +02:00
Jupiter 7fa9f1c9cf Fix broken link to rsocket protocol page
Closes gh-28817
2022-07-19 10:14:46 +02:00
Phillip Webb 578f155809 Polishing 2022-07-18 15:01:51 +01:00
Stephane Nicoll 444e06fa22 Harmonize visibility of RuntimeHints builders
Closes gh-28835
2022-07-18 14:09:52 +02:00
Phillip Webb 87b83e8291 Make MethodName package-private
Closes gh-28832
2022-07-18 11:20:43 +01:00
Phillip Webb 0ea4ee163c Polishing 2022-07-18 10:54:30 +01:00
Stephane Nicoll 75ab47b57c Link factoryMethod consistently in AOT-generated bean definitions
Closes gh-28748
2022-07-18 10:06:48 +01:00
Phillip Webb f2d31b7a20 Migrate AOT tests to use GeneratedClasses and refine/polish AOT APIs
Migrate all AOT tests to make use of `GeneratedClasses` rather than
directly generating Java files. This commit also refines and polishes
AOT APIs to being greater consistency.

Specifically:

	- The `MethodGenerator` interface has been removed in favor of
	  working directly with `GeneratedMethods`.
	- The visibility of several constructors and methods has been
	  reduced to package-private.
	- The `using(...)` and `builder` methods have been removed in
	  favor of setting the `Consumer` callbacks directly as
	  constructor arguments.
	- Variable names for builders are now named `type` or `method`
	  depending on what they're building.

Closes gh-28831
2022-07-18 08:40:59 +01:00
Sam Brannen 4f8516e2c3 Polishing 2022-07-15 18:24:55 +02:00
Sam Brannen 72e4a5f9fe Fix precondition check in TestClassScanner and improve Javadoc
- remove not-empty precondition check for packageNames so that the core
  scan() method can actually be used.
- document constructor
- document use case for packageNames
- add test that scan's all test classes in the spring-test project
- reduce logging due to the previous action item

See gh-28824
2022-07-15 17:10:47 +02:00
Sam Brannen 3fd72652be Fix @ExtendWith search in TestClassScanner
The search algorithm for @ExtendWith should not be tied to Spring's
@NestedTestConfiguration semantics. Rather, general JUnit annotation
search semantics should be used to find @ExtendWith.

See gh-28824
2022-07-15 16:46:39 +02:00
Sam Brannen 1f3ea5133f Polishing 2022-07-15 15:28:47 +02:00
Brian Clozel 77f8408e80 Polish
Closes gh-28751
2022-07-15 14:28:19 +02:00
Sam Brannen c34ccfdb81 Simplify @EneabledIfRuntimeHintsAgent support
Since the RuntimeHintsAgentCondition is based solely on the result of
invoking a boolean static method, there is no need to implement a custom
ExecutionCondition. For such use cases, the @EnabledIf support in JUnit
Jupiter is sufficient.

This commit therefore replaces the custom RuntimeHintsAgentCondition
with use of @EnabledIf as a meta-annotation.
2022-07-15 14:22:06 +02:00
Sam Brannen f5503298fb Handle missing dependencies for optional TestExecutionListener again
Commit d1b65f6d3e introduced a regression regarding the handling of
missing dependencies for optional (typically default)
TestExecutionListeners.

Prior to d1b65f6d3e a TestExecutionListener was instantiated using
java.lang.Class.newInstance() which never throws an
InvocationTargetException. With the switch to the new
SpringFactoriesLoader APIs, a TestExecutionListener is now instantiated
using java.lang.reflect.Constructor.newInstance(Object...) which can
throw an InvocationTargetException.

This commit addresses the regression by unwrapping the target exception
in an InvocationTargetException.

See gh-28666
Closes gh-28828
2022-07-15 13:50:32 +02:00
Sam Brannen 9962aa00a0 Introduce TestClassScanner to locate Spring test classes for AOT processing
This commit introduces the TestClassScanner which scans provided
classpath roots for Spring integration test classes using the JUnit
Platform Launcher API which allows all registered TestEngines to
discover tests according to their own rules.

The scanner currently detects the following categories of Spring
integration test classes.

- JUnit Jupiter: classes that register the SpringExtension via
  @ExtendWith.
- JUnit 4: classes that register the SpringJUnit4ClassRunner or
  SpringRunner via @RunWith.
- Generic: classes that are annotated with @ContextConfiguration or
  @BootstrapWith.

The scanner has been tested with the following TestEngine
implementations for the JUnit Platform.

- JUnit Jupiter
- JUnit Vintage
- JUnit Platform Suite Engine
- TestNG Engine for the JUnit Platform

Closes gh-28824
2022-07-15 13:21:22 +02:00
Arjen Poutsma db43425bf9 Javadoc 2022-07-14 15:24:47 +02:00
Arjen Poutsma f145b53fc8 Use existing context path in DefaultServerRequestBuilder
Closes gh-28820
2022-07-14 15:24:44 +02:00
Arjen Poutsma 1e03b30d33 Use existing context path in DefaultServerRequestBuilder
Closes gh-28820
2022-07-14 15:10:31 +02:00
rstoyanchev bf63309d05 Allow empty path in MockMvc
Closes gh-28823
2022-07-14 12:50:57 +01:00
Stephane Nicoll 963fd75aff Merge branch '5.3.x' 2022-07-14 11:34:36 +02:00