-
Notifications
You must be signed in to change notification settings - Fork 155
Refactor Managed Identity unit tests #957
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
5782538
Refactor ManagedIdentityTests
Avery-Dunn 664230b
Add new constants file
Avery-Dunn c6d2fe6
Update msal4j-sdk/src/test/java/com/microsoft/aad/msal4j/ManagedIdent…
Avery-Dunn d1f51ed
Update constant
Avery-Dunn 8e68c92
Update msal4j-sdk/src/test/java/com/microsoft/aad/msal4j/ManagedIdent…
Avery-Dunn d5a5a7d
Merge branch 'dev' into avdunn/refactor-msitests
Avery-Dunn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
msal4j-sdk/src/test/java/com/microsoft/aad/msal4j/ManagedIdentityTestConstants.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the MIT License. | ||
|
|
||
| package com.microsoft.aad.msal4j; | ||
|
|
||
| class ManagedIdentityTestConstants { | ||
| // ID types | ||
| static final String CLIENT_ID = "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"; | ||
| static final String RESOURCE_ID = "/subscriptions/ffa4aaa2-4444-4444-5555-e3ccedd3d046/resourcegroups/UAMI_group/providers/Microsoft.ManagedIdentityClient/userAssignedIdentities/UAMI"; | ||
| static final String OBJECT_ID = "593b2662-5af7-4a90-a9cb-5a9de615b82f"; | ||
|
|
||
| // Resources | ||
| static final String RESOURCE = "https://management.azure.com"; | ||
| static final String RESOURCE_DEFAULT_SUFFIX = "https://management.azure.com/.default"; | ||
|
|
||
| // Endpoints | ||
| static final String APP_SERVICE_ENDPOINT = "http://127.0.0.1:41564/msi/token"; | ||
| static final String IMDS_ENDPOINT = "http://169.254.169.254/metadata/identity/oauth2/token"; | ||
| static final String AZURE_ARC_ENDPOINT = "http://localhost:40342/metadata/identity/oauth2/token"; | ||
| static final String CLOUDSHELL_ENDPOINT = "http://localhost:40342/metadata/identity/oauth2/token"; | ||
| static final String SERVICE_FABRIC_ENDPOINT = "http://localhost:40342/metadata/identity/oauth2/token"; | ||
|
|
||
| // Example responses | ||
| static final String RESPONSE_MALFORMED_JSON = "missing starting bracket \"access_token\":\"accesstoken\",\"token_type\":" + "\"Bearer\",\"client_id\":\"a bunch of problems}"; | ||
| static final String MSI_ERROR_RESPONSE_500 = "{\"statusCode\":\"500\",\"message\":\"An unexpected error occurred while fetching the AAD Token.\",\"correlationId\":\"7d0c9763-ff1d-4842-a3f3-6d49e64f4513\"}"; | ||
| static final String CLOUDSHELL_ERROR_RESPONSE = "{\"error\":{\"code\":\"AudienceNotSupported\",\"message\":\"Audience user.read is not a supported MSI token audience.\"}}"; | ||
| static final String MSI_ERROR_RESPONSE_NORETRY = "{\"statusCode\":\"123\",\"message\":\"Not one of the retryable error responses\",\"correlationId\":\"7d0c9763-ff1d-4842-a3f3-6d49e64f4513\"}"; | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.