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

Introduce the fragment app check when adding the app role association #6185

Merged

Conversation

ShanChathusanda93
Copy link
Contributor

Proposed changes in this pull request

Copy link

codecov bot commented Dec 8, 2024

Codecov Report

Attention: Patch coverage is 47.91667% with 25 lines in your changes missing coverage. Please review.

Project coverage is 45.56%. Comparing base (b4c7215) to head (03e663d).
Report is 116 commits behind head on master.

Files with missing lines Patch % Lines
...ty/role/v2/mgt/core/RoleManagementServiceImpl.java 48.48% 9 Missing and 8 partials ⚠️
...on/mgt/listener/DefaultRoleManagementListener.java 0.00% 8 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #6185      +/-   ##
============================================
+ Coverage     40.93%   45.56%   +4.63%     
+ Complexity    15735    14108    -1627     
============================================
  Files          1812     1631     -181     
  Lines        126414   100847   -25567     
  Branches      22448    16960    -5488     
============================================
- Hits          51746    45951    -5795     
+ Misses        67057    48194   -18863     
+ Partials       7611     6702     -909     
Flag Coverage Δ
unit 28.31% <47.91%> (+0.14%) ⬆️

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.

@ShanChathusanda93 ShanChathusanda93 force-pushed the fragment-app-check-branch branch 2 times, most recently from 2e2fe44 to 9804566 Compare December 9, 2024 06:55
AnuradhaSK
AnuradhaSK previously approved these changes Dec 10, 2024
@AnuradhaSK
Copy link
Contributor

Add unit test to cover changed code

@ShanChathusanda93 ShanChathusanda93 force-pushed the fragment-app-check-branch branch 6 times, most recently from 374239f to 7e50459 Compare December 14, 2024 07:32
@ShanChathusanda93 ShanChathusanda93 force-pushed the fragment-app-check-branch branch 3 times, most recently from 833da37 to 0ef30a7 Compare December 16, 2024 10:59
Comment on lines 274 to 276
// Remove the mocked threadLocalProperties.
Map<String, Object> threadLocalProperties = new HashMap<>();
IdentityUtil.threadLocalProperties.set(threadLocalProperties);
}
Copy link
Contributor

@AnuradhaSK AnuradhaSK Dec 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here can't we validate whether the thread local property is removed ? Then that will be also an assertion as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No we cant because the thread local property will be added from a listener and the listeners are not executing when the test method is running.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes specifically adding the property before test method is required,
but when executing the test method "private boolean isFragmentApp()" method should be invoked in this case and it should remove the thread local right?

Given that is the expectation, here we can validate that thread local property has been removed at the end

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assertion added to check whether the thread local property is cleared

@ShanChathusanda93 ShanChathusanda93 force-pushed the fragment-app-check-branch branch from 0ef30a7 to 9969ce2 Compare December 16, 2024 12:51
@ShanChathusanda93 ShanChathusanda93 force-pushed the fragment-app-check-branch branch 2 times, most recently from 1978f96 to b268a5e Compare December 16, 2024 18:52
@ShanChathusanda93 ShanChathusanda93 force-pushed the fragment-app-check-branch branch from b268a5e to 03e663d Compare December 17, 2024 05:15
@jenkins-is-staging
Copy link

PR builder started
Link: https://github.com/wso2/product-is/actions/runs/12367206077

@jenkins-is-staging
Copy link

PR builder completed
Link: https://github.com/wso2/product-is/actions/runs/12367206077
Status: success

Copy link

@jenkins-is-staging jenkins-is-staging left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving the pull request based on the successful pr build https://github.com/wso2/product-is/actions/runs/12367206077

@ShanChathusanda93 ShanChathusanda93 merged commit d269820 into wso2:master Dec 17, 2024
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.

Support for creating OAuth 2.0 clients inside B2B organizations for B2B API access
3 participants