test: add unit tests for AdminPolicy#166
Conversation
📝 WalkthroughWalkthroughA new JUnit 5 test class for Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/test/java/org/example/vet1177/policy/AdminPolicyTest.java (1)
9-10: Minor: Prefer consistent AssertJ import source.Line 10 imports
assertThatThrownByfromAssertionsForClassTypeswhile line 9 imports fromAssertions. Both methods are available fromAssertions, so using the same base class improves consistency.♻️ Suggested fix
import static org.assertj.core.api.Assertions.assertThatNoException; -import static org.assertj.core.api.AssertionsForClassTypes.assertThatThrownBy; +import static org.assertj.core.api.Assertions.assertThatThrownBy;🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/test/java/org/example/vet1177/policy/AdminPolicyTest.java` around lines 9 - 10, Replace the inconsistent AssertJ static import for assertThatThrownBy so both assertions come from the same Assertions class: change the static import of assertThatThrownBy (currently from org.assertj.core.api.AssertionsForClassTypes) to use org.assertj.core.api.Assertions.assertThatThrownBy so it matches assertThatNoException; no other code changes required.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/test/java/org/example/vet1177/policy/AdminPolicyTest.java`:
- Around line 9-10: Replace the inconsistent AssertJ static import for
assertThatThrownBy so both assertions come from the same Assertions class:
change the static import of assertThatThrownBy (currently from
org.assertj.core.api.AssertionsForClassTypes) to use
org.assertj.core.api.Assertions.assertThatThrownBy so it matches
assertThatNoException; no other code changes required.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: bcd17e7e-35dc-490a-8766-fb6595782f09
📒 Files selected for processing (1)
src/test/java/org/example/vet1177/policy/AdminPolicyTest.java
Closes #165
Täcker requireAdmin för rollerna ADMIN, OWNER och VET samt null-användare.
Summary by CodeRabbit