TC-ADD-04
Negative
Security
changes data Sending without authentication
Verify endpoint protection
! Documented discrepancy · errors.txt
The request without the Authorization header leads to error code 403, not 401. The only thing that leads to a 401 code is an Authorization header with “Bearer“ prefix and a non-valid token.
All tests in this section: All the import tests return the code 202 and not 200 in case of success.
Specification · xlsx
Steps
- Send the request without an Authorization header
Expected result
HTTP 401 Unauthorized
Endpoints
POST /product/api/v1/merchant-integration/import Run
- API_URL
https://api.qa2.ananastest.com
A dry run builds every request without sending it; responses come from a local stub.
Test code
mirrors tests/ImportTest.php::tc_add_04()
152// Verify endpoint protection
153public function tc_add_04(): void
154{
155 $this->ananas->setToken('1');
156
157 $response = $this->ananas->addOrEditInBulk([]);
158 $this->assertEquals(401, $response['statusCode']);
159}
web/app/Scenarios/ImportScenarios.php · line numbers refer to this file
Not run yet. Run it against the API, or do a dry run to see the requests it would send.