Skip to content

Commit e6a7a9d

Browse files
committed
Fix QueryTest#testScalarQuery for MySQL
The native query now returns an object of type java.sql.Timestamp
1 parent 4d8db6c commit e6a7a9d

File tree

1 file changed

+3
-1
lines changed
  • hibernate-reactive-core/src/test/java/org/hibernate/reactive

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*/
66
package org.hibernate.reactive;
77

8+
import java.sql.Timestamp;
89
import java.time.LocalDateTime;
910
import java.time.OffsetDateTime;
1011
import java.util.ArrayList;
@@ -37,6 +38,7 @@
3738

3839
import static jakarta.persistence.CascadeType.PERSIST;
3940
import static jakarta.persistence.FetchType.LAZY;
41+
import static org.assertj.core.api.Assertions.assertThat;
4042
import static org.hibernate.reactive.containers.DatabaseConfiguration.dbType;
4143
import static org.hibernate.reactive.testing.ReactiveAssertions.assertThrown;
4244

@@ -535,7 +537,7 @@ public void testNamedNativeProjectionQuery(TestContext context) {
535537
public void testScalarQuery(TestContext context) {
536538
test( context, openSession()
537539
.thenCompose( s -> s.createNativeQuery( selectCurrentTimestampQuery() ).getSingleResult() )
538-
.thenAccept( r -> context.assertTrue( r instanceof OffsetDateTime || r instanceof LocalDateTime ) )
540+
.thenAccept( r -> assertThat( r ).isInstanceOfAny( Timestamp.class, OffsetDateTime.class, LocalDateTime.class ) )
539541
);
540542
}
541543

0 commit comments

Comments
 (0)