Skip to content
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

Added unit tests for test RegexViolationErrorMsgFromSecondaryUserStore #897

Merged

Conversation

Sachin-Mamoru
Copy link
Contributor

This pull request introduces new test cases and helper methods to improve the validation of usernames in secondary user stores. The most important changes include adding a new test method to verify error messages from secondary user stores, and creating helper methods to mock the necessary components for these tests.

New Test Cases:

  • Added testRegexViolationErrorMsgFromSecondaryUserStore method to verify that the correct error message is fetched from the secondary user store when a username violates the regex pattern.

Helper Methods:

  • Created setupRealmServiceMocks method to mock the RealmService and associated components.
  • Created setupPrimaryUserStoreManager method to mock the primary user store manager and its configurations.
  • Created setupSecondaryUserStoreManager method to mock the secondary user store manager and its configurations.
  • Created injectMockedRealmService method to inject the mocked RealmService into the IdentityRecoveryServiceDataHolder.
  • Created createRequestDTO method to create a UsernameValidationRequestDTO with specified username and realm properties.

Related Issues

Related PRs

Copy link

codecov bot commented Jan 1, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 50.70%. Comparing base (3dafa8d) to head (74f521e).
Report is 2 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master     #897      +/-   ##
============================================
+ Coverage     50.59%   50.70%   +0.11%     
+ Complexity     2429     2427       -2     
============================================
  Files           298      298              
  Lines         17979    17979              
  Branches       2584     2585       +1     
============================================
+ Hits           9097     9117      +20     
+ Misses         7738     7716      -22     
- Partials       1144     1146       +2     
Flag Coverage Δ
unit 38.53% <ø> (+0.11%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Sachin-Mamoru Sachin-Mamoru merged commit 1e19ba6 into wso2-extensions:master Jan 2, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants