[#13304] Refactoring for Unit Test Access Controls - Tests 51 and 53 #13390
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #13304
Outline of Solution
Refactored tests
GetFeedbackResponseCommentActionTest.java(51) andGetFeedbackSessionActionTest.java(53). I did ask to refactor for tests 51 through to 53 but I wasn't able to figure out a solution forGetFeedbackResponsesActionTest.java(52) in a confident and timely manner.My solution for test 51 simply just cleans up the
setup()method and implements a helper function,generateComment()to reduce code bloat and improve readability.My solution for test 53 moves the login initialization and logout cleanup into the
startup()and the (new)tearDown()methods instead of having them called independently for each test. I also implemented a helper function,configureFeedbackSession(), for the repetitive feedback configuration chains in every test.Note that files other than those specified for refactoring were altered to help me with compilation and so they're not a part of my solutions.