- Convert all existing .bru files from JSON to Bruno DSL format - Remove obsolete files (conflicts/api.bru, kobo/Kobo Initialization.bru) - Update auth configuration to use 'inherit' instead of explicit bearer tokens - Add comprehensive documentation to all test files - Improve test scripts with proper assertions and error handling
60 lines
1.3 KiB
Plaintext
60 lines
1.3 KiB
Plaintext
meta {
|
|
name: Bulk Remove Books - Invalid IDs
|
|
type: http
|
|
seq: 4
|
|
}
|
|
|
|
post {
|
|
url: {{baseUrl}}/api/collections/{{collection_id}}/books/bulk-remove
|
|
body: json
|
|
auth: inherit
|
|
}
|
|
|
|
headers {
|
|
Content-Type: application/json
|
|
Authorization: Bearer {{authToken}}
|
|
}
|
|
|
|
body:json {
|
|
{
|
|
"book_ids": [
|
|
"{{bookId1}}",
|
|
"invalid-uuid-format",
|
|
"{{bookId2}}"
|
|
]
|
|
}
|
|
}
|
|
|
|
script:post-response {
|
|
function onResponse(res) {
|
|
if (res.getStatus() === 200) {
|
|
tests['Partial success accepted'] = true;
|
|
const body = res.getBody();
|
|
tests['Has removed count'] = body.removed !== undefined;
|
|
tests['Has results array'] = Array.isArray(body.results);
|
|
}
|
|
}
|
|
onResponse(res);
|
|
}
|
|
|
|
settings {
|
|
encodeUrl: true
|
|
timeout: 0
|
|
}
|
|
|
|
docs {
|
|
## Bulk Remove Books - Invalid IDs
|
|
|
|
Tests behavior when the book_ids array contains invalid UUID formats or non-existent books.
|
|
|
|
**Expected Result:** 200 OK with partial success
|
|
|
|
**Purpose:** Verifies that:
|
|
- Invalid UUID formats don't crash the endpoint
|
|
- Non-existent book IDs are handled gracefully
|
|
- Valid IDs in the same request are still processed
|
|
- Response includes detailed results showing which succeeded/failed
|
|
|
|
**Note:** The endpoint should process all valid IDs and report failures for invalid ones, allowing clients to handle partial failures appropriately.
|
|
}
|