Increasing test coverage.
Merge remote-tracking branch 'origin/master' into DEP-368-fix-permanent-refresh-tokens