improved unit tests of authentication handlers