Add tests for token based authentication