Skip to content

Comments

refactor: update core traits for testability and remove unnecessary#499

Merged
NathaelB merged 5 commits intomainfrom
feat/write-test-for-role
Oct 17, 2025
Merged

refactor: update core traits for testability and remove unnecessary#499
NathaelB merged 5 commits intomainfrom
feat/write-test-for-role

Conversation

@NathaelB
Copy link
Member

Clone bounds

  • Add #[cfg_attr(test, mockall::automock)] to repository traits for easier mocking
  • Remove Clone and 'static bounds from most service and policy traits
  • Use Arc for repository fields in service structs to enable shared ownership
  • Update constructors and usages to wrap repositories in Arc
  • Update dependencies and lockfile for mockall and related crates
  • Add and update test helpers for service layer unit tests

Clone bounds

- Add `#[cfg_attr(test, mockall::automock)]` to repository traits for
  easier mocking
- Remove `Clone` and `'static` bounds from most service and policy
  traits
- Use `Arc` for repository fields in service structs to enable shared
  ownership
- Update constructors and usages to wrap repositories in `Arc`
- Update dependencies and lockfile for mockall and related crates
- Add and update test helpers for service layer unit tests
Includes tests for:
- ManageRealm permission
- Users without realm
- Insufficient permissions
- No roles assigned
- Cross-realm access from master realm
@NathaelB NathaelB marked this pull request as ready for review October 15, 2025 22:52
@NathaelB NathaelB merged commit 13be4c4 into main Oct 17, 2025
9 checks passed
@NathaelB NathaelB deleted the feat/write-test-for-role branch October 17, 2025 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants