-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add unit tests for Native Auth #1966
Conversation
The code in this pull request is for the base work needed to support Signup, SignIn and SSPR features for Native Auth. Any class that is used by at least two of the features has been included in this pull request. This pull request introduces kotlin co routines libraries as dependencies for msal and its associated test project. Further mockk, mockito libraries have been added as dependencies for test projects. A companion PR in the MSAL Common repository is AzureAD/microsoft-authentication-library-common-for-android#2166
ciam-feature will be update to 82f5153 commit of dev branch --------- Co-authored-by: melissaahn <[email protected]> Co-authored-by: iamgusain <[email protected]> Co-authored-by: Dome Pongmongkol <[email protected]> Co-authored-by: Sowmya Malayanur <[email protected]>
ciam-feature is updated to 991c541 commit from dev branch --------- Co-authored-by: melissaahn <[email protected]> Co-authored-by: iamgusain <[email protected]> Co-authored-by: Dome Pongmongkol <[email protected]> Co-authored-by: Sowmya Malayanur <[email protected]> Co-authored-by: Mohit <[email protected]> Co-authored-by: tanmaymanolkar1 <[email protected]> Co-authored-by: amoyixi <[email protected]> Co-authored-by: yixilin <[email protected]> Co-authored-by: fadidurah <[email protected]> Co-authored-by: Dean Xu <[email protected]>
This PR includes the work for SignIn relates features of Native Auth Companion PR in MSAL Common repo is AzureAD/microsoft-authentication-library-common-for-android#2207
This PR includes the work for Signup related features of Native Auth. No new dependencies have been added as part of this PR. A technical overview of Native Auth is available at https://dev.azure.com/IdentityDivision/DevEx/_git/AuthLibrariesApiReview?path=/%5BAndroid%5D%20Native%20authentication/technical_overview.md&version=GBsammy/native-authentication&_a=preview A companion PR in MSAL Common is AzureAD/microsoft-authentication-library-common-for-android#2229
ciam-feature is updated to 9735ed9 commit from dev branch --------- Co-authored-by: melissaahn <[email protected]> Co-authored-by: iamgusain <[email protected]> Co-authored-by: Dome Pongmongkol <[email protected]> Co-authored-by: Sowmya Malayanur <[email protected]> Co-authored-by: Mohit <[email protected]> Co-authored-by: tanmaymanolkar1 <[email protected]> Co-authored-by: amoyixi <[email protected]> Co-authored-by: yixilin <[email protected]> Co-authored-by: fadidurah <[email protected]> Co-authored-by: Dean Xu <[email protected]> Co-authored-by: Neha Goel <[email protected]> Co-authored-by: Dome Pongmongkol <[email protected]> Co-authored-by: pedro romero vargas <[email protected]>
This PR includes the work for self service password reset related features of Native Auth. No new dependencies have been added as part of this PR. A technical overview of Native Auth is available at https://dev.azure.com/IdentityDivision/DevEx/_git/AuthLibrariesApiReview?path=/%5BAndroid%5D%20Native%20authentication/technical_overview.md&version=GBsammy/native-authentication&_a=preview A companion PR in MSAL is AzureAD/microsoft-authentication-library-common-for-android#2230
...java/com/microsoft/identity/client/nativeauth/NativeAuthPublicClientApplicationJavaTest.java
Outdated
Show resolved
Hide resolved
...java/com/microsoft/identity/client/nativeauth/NativeAuthPublicClientApplicationKotlinTest.kt
Outdated
Show resolved
Hide resolved
@@ -842,6 +842,8 @@ public static INativeAuthPublicClientApplication createNativeAuthPublicClientApp | |||
null, | |||
null | |||
); | |||
} catch (MsalException e) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MsalException is a type of BaseException. The below clause was converting all MsalExceptions into unknown MsalException.
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
// THE SOFTWARE. | ||
package com.microsoft.identity.client |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be in dedicated native auth folder
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and we should update code owners with this path
@@ -62,7 +62,13 @@ jobs: | |||
- task: Gradle@2 | |||
displayName: Run Unit tests | |||
inputs: | |||
tasks: msal:testLocalDebugUnitTest -Plabtest -ProbolectricSdkVersion=${{variables.robolectricSdkVersion}} | |||
tasks: msal:testLocalDebugUnitTest -Plabtest -ProbolectricSdkVersion=${{variables.robolectricSdkVersion}} --tests *com.microsoft.identity.client* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shahzaibj and @fadidurah can you review this? As this is a change to your test configuration, CI, etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't seen --tests used before, but i'm guessing you're just spliting the test suite into native auth and non-native auth, which seems fine to me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, this runs tests in the specified package.
This PR adds unit tests for Native Auth. No new dependency has been added.