I am trying to do JUnit tests with H2, and my APP is configurated to work with PostgreSQL, and with ACL's Spring Boot.
So I have to add into the app the next two lines,
mutableAclService.setClassIdentityQuery("select currval(pg_get_serial_sequence('acl_class', 'id'))");
mutableAclService.setSidIdentityQuery("select currval(pg_get_serial_sequence('acl_sid', 'id'))");
to create the AclService.
I have in the application.properties the configuration spring.datasource.url=jdbc:h2:~/test_db;MODE=PostgreSQL.
But it always returns me,
org.springframework.jdbc.UncategorizedSQLException: StatementCallback; uncategorized SQLException for SQL [select currval(pg_get_serial_sequence('acl_sid', 'id'))]; SQL state [90022]; error code [90022]; Function "PG_GET_SERIAL_SEQUENCE" not found; SQL statement:
select currval(pg_get_serial_sequence('acl_sid', 'id')) [90022-197]; nested exception is org.h2.jdbc.JdbcSQLException: Function "PG_GET_SERIAL_SEQUENCE" not found; SQL statement
...
Anyone knows how to fix it?