Skip to content

Commit 3b3252a

Browse files
committed
[#1501] Fix SubselectFetchTest
1 parent ff0f8a0 commit 3b3252a

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

hibernate-reactive-core/src/test/java/org/hibernate/reactive/SubselectFetchTest.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
import org.hibernate.annotations.FetchMode;
1515

1616
import org.junit.jupiter.api.AfterEach;
17-
import org.junit.jupiter.api.Disabled;
1817
import org.junit.jupiter.api.Test;
1918

2019
import io.vertx.junit5.Timeout;
@@ -43,7 +42,6 @@
4342
import static org.junit.jupiter.api.Assertions.assertFalse;
4443
import static org.junit.jupiter.api.Assertions.assertTrue;
4544

46-
@Disabled // see https://github.com/hibernate/hibernate-reactive/issues/1502
4745
@Timeout(value = 10, timeUnit = MINUTES)
4846
public class SubselectFetchTest extends BaseReactiveTest {
4947

@@ -59,6 +57,10 @@ public void cleanDb(VertxTestContext context) {
5957
.thenCompose( v -> s.createQuery( "delete from Node" ).executeUpdate() ) ) );
6058
}
6159

60+
/**
61+
* @see org.hibernate.orm.test.mapping.fetch.subselect.SubselectFetchTest#testSubselectFetchHql()
62+
* @param context
63+
*/
6264
@Test
6365
public void testQuery(VertxTestContext context) {
6466
Node basik = new Node( "Child" );
@@ -80,6 +82,11 @@ public void testQuery(VertxTestContext context) {
8082
Node n2 = list.get( 1 );
8183
assertFalse( isInitialized( n1.getElements() ), "'n1.elements' should not be initialized" );
8284
assertFalse( isInitialized( n2.getElements() ), "'n2.elements' should not be initialized" );
85+
86+
// .size() triggers loading of elements
87+
assertTrue( n1.getElements().size() == 3 );
88+
assertTrue( n2.getElements().size() == 2 );
89+
8390
return s.fetch( n1.getElements() ).thenAccept( elements -> {
8491
assertTrue( isInitialized( elements ), "'elements' - after fetch - should be initialized" );
8592
assertTrue( isInitialized( n1.getElements() ), "'n1.elements' - after fetch - should be initialized" );

0 commit comments

Comments
 (0)