-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Fix ClassNotFoundException for StringUtils in AAD starter #47601
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
+85
−2
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
adc59ec
Initial plan
Copilot 3b7cc4a
Replace nimbusds StringUtils with Spring Framework StringUtils
Copilot 4aa52b9
Update CHANGELOG.md with StringUtils fix
Copilot 0df48e8
Fix issue number in CHANGELOG.md
Copilot 65b3ce9
Remove redundant assertTrue assertions from tests
Copilot 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
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
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
74 changes: 74 additions & 0 deletions
74
...onfigure/implementation/aad/security/properties/AadAuthorizationServerEndpointsTests.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,74 @@ | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the MIT License. | ||
|
|
||
| package com.azure.spring.cloud.autoconfigure.implementation.aad.security.properties; | ||
|
|
||
| import org.junit.jupiter.api.Test; | ||
|
|
||
| import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
|
||
| class AadAuthorizationServerEndpointsTests { | ||
|
|
||
| private static final String DEFAULT_BASE_URI = "https://login.microsoftonline.com/"; | ||
| private static final String CUSTOM_BASE_URI = "https://custom.endpoint.com/"; | ||
| private static final String TENANT_ID = "test-tenant-id"; | ||
|
|
||
| @Test | ||
| void constructorWithNullBaseUri() { | ||
| AadAuthorizationServerEndpoints endpoints = new AadAuthorizationServerEndpoints(null, TENANT_ID); | ||
| assertEquals(DEFAULT_BASE_URI, endpoints.getBaseUri()); | ||
| } | ||
|
|
||
| @Test | ||
| void constructorWithEmptyBaseUri() { | ||
| AadAuthorizationServerEndpoints endpoints = new AadAuthorizationServerEndpoints("", TENANT_ID); | ||
| assertEquals(DEFAULT_BASE_URI, endpoints.getBaseUri()); | ||
| } | ||
|
|
||
| @Test | ||
| void constructorWithWhitespaceBaseUri() { | ||
| AadAuthorizationServerEndpoints endpoints = new AadAuthorizationServerEndpoints(" ", TENANT_ID); | ||
| assertEquals(DEFAULT_BASE_URI, endpoints.getBaseUri()); | ||
| } | ||
|
|
||
| @Test | ||
| void constructorWithValidBaseUri() { | ||
| AadAuthorizationServerEndpoints endpoints = new AadAuthorizationServerEndpoints(CUSTOM_BASE_URI, TENANT_ID); | ||
| assertEquals(CUSTOM_BASE_URI, endpoints.getBaseUri()); | ||
| } | ||
|
|
||
| @Test | ||
| void constructorWithBaseUriWithoutTrailingSlash() { | ||
| String baseUriWithoutSlash = "https://custom.endpoint.com"; | ||
| AadAuthorizationServerEndpoints endpoints = new AadAuthorizationServerEndpoints(baseUriWithoutSlash, TENANT_ID); | ||
| assertEquals(baseUriWithoutSlash + "/", endpoints.getBaseUri()); | ||
| } | ||
|
|
||
| @Test | ||
| void getAuthorizationEndpoint() { | ||
| AadAuthorizationServerEndpoints endpoints = new AadAuthorizationServerEndpoints(DEFAULT_BASE_URI, TENANT_ID); | ||
| String authEndpoint = endpoints.getAuthorizationEndpoint(); | ||
| assertEquals(DEFAULT_BASE_URI + TENANT_ID + "/oauth2/v2.0/authorize", authEndpoint); | ||
| } | ||
|
|
||
| @Test | ||
| void getTokenEndpoint() { | ||
| AadAuthorizationServerEndpoints endpoints = new AadAuthorizationServerEndpoints(DEFAULT_BASE_URI, TENANT_ID); | ||
| String tokenEndpoint = endpoints.getTokenEndpoint(); | ||
| assertEquals(DEFAULT_BASE_URI + TENANT_ID + "/oauth2/v2.0/token", tokenEndpoint); | ||
| } | ||
|
|
||
| @Test | ||
| void getJwkSetEndpoint() { | ||
| AadAuthorizationServerEndpoints endpoints = new AadAuthorizationServerEndpoints(DEFAULT_BASE_URI, TENANT_ID); | ||
| String jwkSetEndpoint = endpoints.getJwkSetEndpoint(); | ||
| assertEquals(DEFAULT_BASE_URI + TENANT_ID + "/discovery/v2.0/keys", jwkSetEndpoint); | ||
| } | ||
|
|
||
| @Test | ||
| void getEndSessionEndpoint() { | ||
| AadAuthorizationServerEndpoints endpoints = new AadAuthorizationServerEndpoints(DEFAULT_BASE_URI, TENANT_ID); | ||
| String endSessionEndpoint = endpoints.getEndSessionEndpoint(); | ||
| assertEquals(DEFAULT_BASE_URI + TENANT_ID + "/oauth2/v2.0/logout", endSessionEndpoint); | ||
| } | ||
| } |
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.