Skip to content

Commit

Permalink
HHH-12251 fix and enable @FailureExpected test
Browse files Browse the repository at this point in the history
Signed-off-by: Gavin King <gavin@hibernate.org>
  • Loading branch information
gavinking committed May 16, 2024
1 parent e8ebaf0 commit 2563eb3
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

import org.hibernate.orm.test.jpa.BaseEntityManagerFunctionalTestCase;

import org.hibernate.testing.FailureExpected;
import org.hibernate.testing.TestForIssue;
import org.junit.Test;

Expand All @@ -38,7 +37,6 @@ protected Class<?>[] getAnnotatedClasses() {
}

@Test
@FailureExpected( jiraKey = "HHH-12251")
public void testMergeCascadesToManyToOne() {

doInJPA( this::entityManagerFactory, entityManager -> {
Expand All @@ -49,9 +47,9 @@ public void testMergeCascadesToManyToOne() {
someEntity.setId( 23L );
someEntity.setReferencedEntity( referencedEntity );

entityManager.merge( someEntity );
SomeEntity merged = entityManager.merge(someEntity);

assertTrue( entityManager.contains( referencedEntity ) );
assertTrue( entityManager.contains( merged.getReferencedEntity() ) );
} );
}

Expand Down Expand Up @@ -80,7 +78,7 @@ public static class SomeEntity {
private long id;

@Id
@ManyToOne(cascade = CascadeType.PERSIST)
@ManyToOne(cascade = {CascadeType.PERSIST, CascadeType.MERGE})
private ReferencedEntity referencedEntity;

public ReferencedEntity getReferencedEntity() {
Expand Down

0 comments on commit 2563eb3

Please sign in to comment.