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

@@ -57,15 +57,6 @@ class SpringJUnitJupiterAutowiredConstructorInjectionTests {
}
}
@Nested
class JavaxInjectTests extends BaseClass {
@javax.inject.Inject
JavaxInjectTests(ApplicationContext context, Person dilbert, Dog dog, @Value("${enigma}") Integer enigma) {
super(context, dilbert, dog, enigma);
}
}
@SpringJUnitConfig(TestConfig.class)
@TestPropertySource(properties = "enigma = 42")

View File

@@ -16,7 +16,6 @@
package org.springframework.test.context.junit4.orm;
import jakarta.persistence.PersistenceException;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.exception.ConstraintViolationException;
@@ -115,16 +114,8 @@ public class HibernateSessionFlushingTests extends AbstractTransactionalJUnit4Sp
@Test
public void updateSamWithNullDriversLicenseWithSessionFlush() {
updateSamWithNullDriversLicense();
assertThatExceptionOfType(ConstraintViolationException.class).isThrownBy(() -> {
// Manual flush is required to avoid false positive in test
try {
sessionFactory.getCurrentSession().flush();
}
catch (PersistenceException ex) {
// Wrapped in Hibernate 5.2, with the constraint violation as cause
throw ex.getCause();
}
});
// Manual flush is required to avoid false positive in test
assertThatExceptionOfType(ConstraintViolationException.class).isThrownBy(sessionFactory.getCurrentSession()::flush);
}
private void updateSamWithNullDriversLicense() {

View File

@@ -42,7 +42,7 @@ public class HibernatePersonRepository implements PersonRepository {
@Override
public Person save(Person person) {
this.sessionFactory.getCurrentSession().save(person);
this.sessionFactory.getCurrentSession().persist(person);
return person;
}