-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
[#12048] Migrate tests for GetAccountActionTest #13212
base: master
Are you sure you want to change the base?
[#12048] Migrate tests for GetAccountActionTest #13212
Conversation
e68354c
to
8a00cea
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, the changes look good! The implementation is clear, and the tests cover the main functionality well. Consider adding a few additional tests to improve coverage and refining the test method name for better clarity. Great work so far!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
Adding a Test for Missing Parameters
Theexecute()
method inGetAccountAction
requires non-null Instructor ID parameter. Would it be helpful to add a test case to ensure the method handles missing parameters correctly? For example:@Test void testExecute_noParameters_throwsInvalidHttpParameterException() { verifyHttpParameterFailure(); }
-
Access Control Test Cases
SinceGetAccountAction
extendsAdminOnlyAction
, do you think it would be beneficial to include tests that verify access control? This can ensure only admins have access to the action. Some possible test cases could be:@Test void testSpecificAccessControl_admin_canAccess() { ... } @Test void testSpecificAccessControl_instructor_cannotAccess() { ... } @Test void testSpecificAccessControl_student_cannotAccess() { ... } @Test void testSpecificAccessControl_loggedOut_cannotAccess() { ... }
} | ||
|
||
@Test | ||
void testExecute_accountDoesNotExist_failSilently() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current method name testExecute_accountDoesNotExist_failSilently()
might not fully reflect the behavior, as the method throws an exception rather than failing silently. Would something like testExecute_accountDoesNotExist_throwsEntityNotFoundException()
be clearer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch!
Part of #12048
Outline of Solution
Change GetAccountActionTest.java to ensure compatibility with the PostgreSQL database following the database migration.