Add minimal test for basic hackathon operations and enhance test utilities

- Introduced a new test module for hackathon-related functionality.
- Implemented a basic test for creating a hackathon using a mock repository.
- Enhanced the test utilities in `lib.rs` for better request handling and response extraction.
- Added a `ServiceClient` struct to facilitate HTTP requests in tests.
- Created a `RequestBuilder` to streamline building and sending requests with headers and JSON bodies.
This commit is contained in:
MythEclipse
2025-10-11 10:58:51 +07:00
parent 466ba3391a
commit c10443f881
33 changed files with 4547 additions and 4082 deletions
+2 -3
View File
@@ -254,8 +254,7 @@ use utoipa::{
(name = "Hackathon Submissions", description = "Hackathon Submission Management Endpoints"),
)
)]
pub struct ApiDoc;
pub struct ApiDoc;
pub struct SecurityAddon;
@@ -275,7 +274,7 @@ impl Modify for SecurityAddon {
let paths = &mut openapi.paths;
for (_path, path_item) in paths.paths.iter_mut() {
// helper to process each possible operation on the path
let mut process_op = |op: &mut Option<utoipa::openapi::path::Operation>| {
let process_op = |op: &mut Option<utoipa::openapi::path::Operation>| {
if let Some(operation) = op.as_mut() {
let mut has_auth_response = false;
let responses = &operation.responses.responses;