Ensure that test secure storage access impl shares and returns token data #415
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Landing #411 revealed a previously hidden issue with SecureStorageAccessTestImpl, a class that we use to avoid interacting with keychain access during tests as setting up keychain access can be flakey.
The client setup flow–before it was fixed in the above PR–potentially created and stored a semi-authed dropbox client when using the custom transport client setup method. By potentially semi authed I mean that the client existed regardless of if an access token was retrieved from secure storage. This obscured the fact that SecureStorageAccessTestImpl was actually itself broken: multiple instances of it didn't share the same backing storage, and
getAllUserIds
, while necessary, was simply unimplemented.The tests continued to pass in this state because, lacking the access token, the client would request a new one via the refresh token, and then proceed as expected.
Once 411 landed, the problems with SecureStorageAccessTestImpl were reflected in a nil DropboxClientsManager.authClient, which broke the tests. This PR fixes the tests by fixing SecureStorageAccessTestImpl, as the new auth client setup behavior is correct.