Refactor: Split AdminSuite and set up route-specific test cases #759
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.
This PR splits the AdminSuite into separate test cases based on individual routes. The goal is to align with the new testing structure where each route has a dedicated test suite.
Changes Made
Extracted test cases from AdminSuite.scala and created the following new test files under route/administration/:
TestDeleteOrgChanges.scala (The test methods are currently commented out because the prerequisites need adjustment.)
TestGetAdminVersion.scala
TestPostAdminHashpw.scala
TestPostAdminReload.scala
Moved CatalogSuite.scala into route/catalog/
I didn't modify most test cases, except TestPostAdminReload.scal. I tried to structure test data using Seq for better organization and to make the style more aligned with the new approach while ensuring functional consistency with the original tests. However, I did not strictly follow the new approach’s exact structure as I focuses more on maintaining test functionality while making the style closer to the expected refactoring pattern. Let me know if further adjustments are needed to better match the intended structure.
Also, in TestGetAdminStatus.scala I only added a missing test case for root/root access failure that wasn’t covered before. It and the original AdminSuite had overlapping test cases, but due to differences in data initialization between the old and new approaches, directly merging them would have required mixing two different data structures. Most of the existing test cases were already covered in TestGetAdminStatus.scala, I opted not to move everything over—only adding the missing failure case for completeness.
Next Step
I plan to continue splitting other large test suites in a similar manner by breaking them down into route-specific tests. Then, I will gradually refine the internal implementation to better align with the new approach, including improving test coverage and verifying response content. Let me know if this direction makes sense, or if there are specific priorities I should focus on.
Note:

This PR is made from a fork since I think I don’t have direct push access. Let me know if I should continue working from a fork or if I can get push permissions for direct contributions.