Skip to content

[#13304] Refactor GetFeedbackQuestionsActionTest to use BaseActionTest#13574

Closed
AlanRQiu wants to merge 2 commits intoTEAMMATES:masterfrom
AlanRQiu:13304-refactor-get-feedback-questions
Closed

[#13304] Refactor GetFeedbackQuestionsActionTest to use BaseActionTest#13574
AlanRQiu wants to merge 2 commits intoTEAMMATES:masterfrom
AlanRQiu:13304-refactor-get-feedback-questions

Conversation

@AlanRQiu
Copy link
Copy Markdown

@AlanRQiu AlanRQiu commented Mar 7, 2026

Part of #13304

Description
This PR refactors GetFeedbackQuestionsActionTest.java to use the abstracted access control test methods migrated to BaseActionTest.java.

Changes
Refactored Access Control: Replaced manual logic with verifyOnlyInstructorsOfTheSameCourseCanAccess to handle multi-role permission checks automatically.

Added Mock Logic: Included when(...).thenReturn(...) for feedback session retrieval to satisfy internal getNonNullSqlFeedbackSession checks during the action's execution.

Standardized Parameters: Created a getActionParams() helper method to reduce redundancy across success and failure test cases.

Updated Failure Tests: Migrated manual parameter failure assertions to use the base class verifyHttpParameterFailure() method.

Verification Results
Ran unit tests locally using:
.\gradlew.bat

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 7, 2026

Hi @AlanRQiu, thank you for your interest in contributing to TEAMMATES!
However, your PR does not appear to follow our contribution guidelines:

  • Description must reference the issue number the PR is fixing, e.g. Fixes #<issue-number> (or Part of #<issue-number> if the PR does not address the issue fully)

Please address the above before we proceed to review your PR.

- Remove duplicate imports of Const and FeedbackSession
- Remove unused import of InstructorPrivileges
- Remove trailing whitespaces from comments

Fixes checkstyle test failures in component tests.
@samuelfangjw
Copy link
Copy Markdown
Member

Thank you for your interest in contributing, please ensure all tests pass before we go ahead and review this PR.

@samuelfangjw
Copy link
Copy Markdown
Member

Closing due to inactivity to keep things tidy and so others can work on it. If you’d like to continue working on it, feel free to reopen the PR or create a new one anytime. Thanks for your contribution!

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