Conversation
| static void assertTokenResultNotNull(IAuthenticationResult result, boolean checkAccessToken, boolean checkIDToken) { | ||
| assertNotNull(result); | ||
| if (checkAccessToken) assertNotNull(result.accessToken()); | ||
| if (checkIDToken) assertNotNull(result.idToken()); |
There was a problem hiding this comment.
You can add a few more asserts here. If the Id token is not null, the Account should also not be null.
There was a problem hiding this comment.
This was just meant to replace the "result & tokens aren't null" check the happens in a lot of tests and I wanted to keep the changes limited on the first PR. The tests that care about the account still have their own asserts, and the next time I work with those tests I'll add another helper method for checking various account info.
|
|
||
| static void assertTokenResultNotNull(IAuthenticationResult result, boolean checkAccessToken, boolean checkIDToken) { | ||
| assertNotNull(result); | ||
| if (checkAccessToken) assertNotNull(result.accessToken()); |
There was a problem hiding this comment.
I am not aware of any case where the access token is null?
There was a problem hiding this comment.
Me neither, I just added it because there were a few tests where we just checked if the result or the ID token was null but not the access token.
However, I just used a 'true' value for both token options in all the tests that now use this, so in the latest commit I changed this helper method to be assertAccessAndIdTokensNotNull and it will always check both tokens.
Contains a number of fixes and improvements to the integration tests: