Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(OAuth2): groovy to java conversion for OAuth module (spinnak…
…er#1871) * refactor(OAuth2): groovy to java conversion for OAuth module Validated and tested using google and github OAuth. * Add specific imports and remove * * Remove DefaultGroovyMethods * Add StructuredArguments.entries * Rename safeGet to toStringOrNull. toStringOrNull returns null when the input is null. Add javadoc * Replace details.getOrDefault with Optional to handle null cases * Add log statement from groovy code * Use AssertJ * First checks log.isDebugEnabled() to avoid unnecessary String concatenation * Add non empty string check * Add test for SpinnakerUserInfoTokenServices#isServiceAccount * Refactor SpinnakerUserInfoTokenServices to use constructor injection - Replaced member injection with constructor injection - Improved encapsulation by removing direct member access - Updated tests to pass dependencies via constructor * Preserve method call verifications in tests * Refactor to use constructor injection - Removed annotations from individual members - Added to the all-args constructor - Removed no-arg constructor to enforce dependency injection - Improved clarity and testability of the class * Add specific imports and remove * * Move SpinnakerProviderTokenServices to constructor argument and make it optional using Optional<SpinnakerProviderTokenServices>
- Loading branch information