Attempted to fix api token unit tests.

Unit tests related to shiro have spontaneously started failing on some but not all of our Jenkins jobs. The tests pass locally, but it's possible that this different way of mocking the objects will avoid a possible race condition or accidental cross-test state sharing when running the tests on Jenkins nodes.