HHH-12251 fix and enable @FailureExpected test

Signed-off-by: Gavin King <gavin@hibernate.org>
This commit is contained in:
Gavin King 2024-05-16 22:57:58 +02:00 committed by Steve Ebersole
parent e5b6b456f9
commit 9a68cd6134
1 changed files with 3 additions and 5 deletions

View File

@ -16,7 +16,6 @@ import jakarta.persistence.ManyToOne;
import org.hibernate.orm.test.jpa.BaseEntityManagerFunctionalTestCase;
import org.hibernate.testing.FailureExpected;
import org.hibernate.testing.TestForIssue;
import org.junit.Test;
@ -38,7 +37,6 @@ public class IdClassManyToOneCascadeTest extends BaseEntityManagerFunctionalTest
}
@Test
@FailureExpected( jiraKey = "HHH-12251")
public void testMergeCascadesToManyToOne() {
doInJPA( this::entityManagerFactory, entityManager -> {
@ -49,9 +47,9 @@ public class IdClassManyToOneCascadeTest extends BaseEntityManagerFunctionalTest
someEntity.setId( 23L );
someEntity.setReferencedEntity( referencedEntity );
entityManager.merge( someEntity );
SomeEntity merged = entityManager.merge(someEntity);
assertTrue( entityManager.contains( referencedEntity ) );
assertTrue( entityManager.contains( merged.getReferencedEntity() ) );
} );
}
@ -80,7 +78,7 @@ public class IdClassManyToOneCascadeTest extends BaseEntityManagerFunctionalTest
private long id;
@Id
@ManyToOne(cascade = CascadeType.PERSIST)
@ManyToOne(cascade = {CascadeType.PERSIST, CascadeType.MERGE})
private ReferencedEntity referencedEntity;
public ReferencedEntity getReferencedEntity() {