-
Notifications
You must be signed in to change notification settings - Fork 827
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
Refactor saml dependencies 186822654 #2700
Conversation
* Split out test assertions that don't depend on SAML * Added a comment about missing test coverage Co-Authored-By: Peter Chen <peter-h.chen@broadcom.com>
* There's no need to rely on SAML features for this test. Co-Authored-By: Peter Chen <peter-h.chen@broadcom.com>
* Facilitated by introducing the uaaPrincipal variable [#186822654] Co-authored-by: Bruce Ricard <bruce.ricard@broadcom.com>
* Creating a new passcode package to later add a PasscodeEndpoint class to. Co-authored-by: Bruce Ricard <bruce.ricard@broadcom.com>
* Note: breaks the build, will fix on the next commit. * This preserves the history of the method we want to extract. Co-authored-by: Bruce Ricard <bruce.ricard@broadcom.com>
* Finish extraction of generatePasscode(). * Moved the RequestMapping to the new PasscodeEndpoint class. * Fixes the build. Co-authored-by: Bruce Ricard <bruce.ricard@broadcom.com>
* Creating a test class for the new PasscodeEndpoint class by extracting existing test methods. * The git history for these tests is in the server/src/main/java/org/cloudfoundry/identity/uaa/login/LoginInfoEndpoint.java class. [#186822654] Co-authored-by: Bruce Ricard <bruce.ricard@broadcom.com>
* Code is moved to become a constructor of the PasscodeInformation class. The code was already used to build the inputs of for a similar constructor call. * Unit tests were adapted from PasscodeEndpointTest (which will be simplified in a later commit). We now have 100% code coverage of the new constructor.
* Removed redundancy with tests in PasscodeInformationTest. * Kept a single test but improved coverage by validating the passcode in the model. * The new comment about the untested code path is no longer relevant/true. Removed the comment.
* Not 100% sure if it's needed still in LoginInfoEndpoint
We have created an issue in Pivotal Tracker to manage this: https://www.pivotaltracker.com/story/show/186957486 The labels on this github issue will be updated when the story is started. |
sonar is not happy with it, therefore I have to check in more details |
Thanks for pointing that out Markus. We'll look into it. |
Why is the Sonar action passing when SonarCloud says it failed? |
* Found by SonarCloud.
* Suggested by SonarCloud.
* Fixes SonarLint warnings.
* Suggested by SonarCloud.
* Use the proper jUnit5 assertEquals.
83c47a0
to
4e340b0
Compare
I have pushed fixes for some of the code smells that Sonar found. However, the Sonar scan still fails because of its code coverage rules. The code we added to PasscodeInformation.java is 100% covered, but Sonar wants us to add coverage for the code that we didn't change, perhaps because we moved it to a new package. We could possibly improve coverage by removing an unused constructor, but we'd need to figure out what to do with the Jackson annotations on that constructor. |
* Covers an untested condition where an Authentication includes a Principal that is not a UaaPrincipal.
5f079f5
to
7f7d284
Compare
* Makes the constructor more consistent with the existing constructor. * Really it's a sneaky trick to improve code coverage in the unit test.
* Refactor because sonar recommended it
We have a couple refactors that will be helpful when replacing the SAML extension library.
They should also help with readability and complexity, in general.
Also added a couple tests, when we found missing coverage.
@swalchemist and me