-
Notifications
You must be signed in to change notification settings - Fork 901
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 Mockito inline dependency and introduce SamlAssertionConsumerFunctionTest #5735
base: main
Are you sure you want to change the base?
Conversation
🔍 Build Scan® (commit: 3e14eef) |
ServiceRequestContext ctx = mock(ServiceRequestContext.class); | ||
AggregatedHttpRequest req = mock(AggregatedHttpRequest.class); |
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.
You don't need to mock these two types. Please use:
ServiceRequestContext.of()
or.builder()
; andAggregatedHttpRequest.of()
.
SamlSingleSignOnHandler ssoHandler = mock(SamlSingleSignOnHandler.class); | ||
SamlAssertionConsumerFunction underTest = new SamlAssertionConsumerFunction( | ||
consumerConfig, "entityId", mock(Map.class), null, | ||
mock(SamlRequestIdManager.class), ssoHandler, false); |
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.
Ditto - we don't need to use Mockito to mock Map
and SamlRequestIdManager
- just pass a new HashMap
and a dummy SamlRequestIdManager
implementation.
…or style compliance
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.
Good to see you after the sprint 👍
@@ -244,6 +244,7 @@ configure(projectsWithFlags('java')) { | |||
testRuntimeOnly libs.checkerframework // Required by guava-testlib | |||
testImplementation libs.assertj | |||
testImplementation libs.mockito | |||
testImplementation libs.mockito.inline |
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.
Perhaps adding this to only the saml
module will help with the build
Line 1 in 579a6d0
dependencies { |
Motivation:
This PR introduces the Mockito inline dependency to enhance mocking capabilities, particularly for final classes and static methods. Additionally, it introduces a new test class SamlAssertionConsumerFunctionTest to ensure the proper functionality of the SamlAssertionConsumerFunction class when login is failed. This is a follow-up to PR #5622.
Modifications:
Result: