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:
@@ -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")
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user