General upgrade to Jakarta EE 11 APIs

Includes removal of ManagedBean and javax.annotation legacy support.
Includes AbstractJson(Http)MessageConverter revision for Yasson 3.0.
Includes initial Hibernate ORM 7.0 upgrade.

Closes gh-34011
Closes gh-33750
This commit is contained in:
Juergen Hoeller
2024-12-03 13:30:25 +01:00
parent 15c6d3449b
commit 949432ce8b
65 changed files with 200 additions and 2995 deletions

View File

@@ -39,9 +39,8 @@ import org.springframework.lang.Nullable;
* on a test class, the default <em>test constructor autowire mode</em> will be
* used. See {@link #TEST_CONSTRUCTOR_AUTOWIRE_MODE_PROPERTY_NAME} for details on
* how to change the default mode. Note, however, that a local declaration of
* {@link org.springframework.beans.factory.annotation.Autowired @Autowired}
* {@link jakarta.inject.Inject @jakarta.inject.Inject}, or
* {@link javax.inject.Inject @javax.inject.Inject} on a constructor takes
* {@link org.springframework.beans.factory.annotation.Autowired @Autowired} or
* {@link jakarta.inject.Inject @jakarta.inject.Inject} on a constructor takes
* precedence over both {@code @TestConstructor} and the default mode.
*
* <p>This annotation may be used as a <em>meta-annotation</em> to create custom
@@ -63,7 +62,6 @@ import org.springframework.lang.Nullable;
* @since 5.2
* @see org.springframework.beans.factory.annotation.Autowired @Autowired
* @see jakarta.inject.Inject @jakarta.inject.Inject
* @see javax.inject.Inject @javax.inject.Inject
* @see org.springframework.test.context.junit.jupiter.SpringExtension SpringExtension
* @see org.springframework.test.context.junit.jupiter.SpringJUnitConfig @SpringJUnitConfig
* @see org.springframework.test.context.junit.jupiter.web.SpringJUnitWebConfig @SpringJUnitWebConfig
@@ -109,7 +107,6 @@ public @interface TestConstructor {
* @see #TEST_CONSTRUCTOR_AUTOWIRE_MODE_PROPERTY_NAME
* @see org.springframework.beans.factory.annotation.Autowired @Autowired
* @see jakarta.inject.Inject @jakarta.inject.Inject
* @see javax.inject.Inject @javax.inject.Inject
* @see AutowireMode#ALL
* @see AutowireMode#ANNOTATED
*/
@@ -126,9 +123,8 @@ public @interface TestConstructor {
/**
* All test constructor parameters will be autowired as if the constructor
* itself were annotated with
* {@link org.springframework.beans.factory.annotation.Autowired @Autowired},
* {@link jakarta.inject.Inject @jakarta.inject.Inject}, or
* {@link javax.inject.Inject @javax.inject.Inject}.
* {@link org.springframework.beans.factory.annotation.Autowired @Autowired} or
* {@link jakarta.inject.Inject @jakarta.inject.Inject}.
* @see #ANNOTATED
*/
ALL,
@@ -140,9 +136,8 @@ public @interface TestConstructor {
* {@link org.springframework.beans.factory.annotation.Qualifier @Qualifier},
* or {@link org.springframework.beans.factory.annotation.Value @Value},
* or if the constructor itself is annotated with
* {@link org.springframework.beans.factory.annotation.Autowired @Autowired},
* {@link jakarta.inject.Inject @jakarta.inject.Inject}, or
* {@link javax.inject.Inject @javax.inject.Inject}.
* {@link org.springframework.beans.factory.annotation.Autowired @Autowired} or
* {@link jakarta.inject.Inject @jakarta.inject.Inject}.
* @see #ALL
*/
ANNOTATED;

View File

@@ -63,15 +63,6 @@ public abstract class TestConstructorUtils {
catch (ClassNotFoundException ex) {
// jakarta.inject API not available - simply skip.
}
try {
autowiredAnnotationTypes.add((Class<? extends Annotation>)
ClassUtils.forName("javax.inject.Inject", classLoader));
logger.trace("'javax.inject.Inject' annotation found and supported for autowiring");
}
catch (ClassNotFoundException ex) {
// javax.inject API not available - simply skip.
}
}
@@ -135,9 +126,8 @@ public abstract class TestConstructorUtils {
* conditions is {@code true}.
*
* <ol>
* <li>The constructor is annotated with {@link Autowired @Autowired},
* {@link jakarta.inject.Inject @jakarta.inject.Inject}, or
* {@link javax.inject.Inject @javax.inject.Inject}.</li>
* <li>The constructor is annotated with {@link Autowired @Autowired} or
* {@link jakarta.inject.Inject @jakarta.inject.Inject}.</li>
* <li>{@link TestConstructor @TestConstructor} is <em>present</em> or
* <em>meta-present</em> on the test class with
* {@link TestConstructor#autowireMode() autowireMode} set to