HHH-18892 add test for md5() function

This commit is contained in:
Gavin King 2024-12-03 19:45:12 +01:00
parent b36ee674ca
commit 5a8db1caa3

View File

@ -2618,6 +2618,13 @@ public void testSha256Function(SessionFactoryScope scope) {
catch (NoSuchAlgorithmException e) {
throw new RuntimeException( e );
}
bytes = s.createSelectionQuery("select md5('hello')", byte[].class).getSingleResult();
try {
assertArrayEquals( MessageDigest.getInstance( "MD5" ).digest("hello".getBytes()), bytes );
}
catch (NoSuchAlgorithmException e) {
throw new RuntimeException( e );
}
});
}
}