Skip to content

Commit 5a8db1c

Browse files
committed
HHH-18892 add test for md5() function
1 parent b36ee67 commit 5a8db1c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

hibernate-core/src/test/java/org/hibernate/orm/test/query/hql/FunctionTests.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2618,6 +2618,13 @@ public void testSha256Function(SessionFactoryScope scope) {
26182618
catch (NoSuchAlgorithmException e) {
26192619
throw new RuntimeException( e );
26202620
}
2621+
bytes = s.createSelectionQuery("select md5('hello')", byte[].class).getSingleResult();
2622+
try {
2623+
assertArrayEquals( MessageDigest.getInstance( "MD5" ).digest("hello".getBytes()), bytes );
2624+
}
2625+
catch (NoSuchAlgorithmException e) {
2626+
throw new RuntimeException( e );
2627+
}
26212628
});
26222629
}
26232630
}

0 commit comments

Comments
 (0)