Unit testing for database access control methods