as

Settings
Sign out
Notifications
Alexa
亚马逊应用商店
AWS
文档
Support
Contact Us
My Cases
Docs
Resources
Ecommerce Plug-ins
Publish
Connect
感谢您的访问。此页面目前仅提供英语版本。我们正在开发中文版本。谢谢您的理解。

Cancel Charge Testing

Summary

While the test cases below outline key testing scenarios, it should be supplemented with your organization's established testing best practices to ensure comprehensive coverage of any use cases not explicitly included in this test plan.

1. Test Case: Successful Cancellation (200 Response)

Objective: Trigger successful charge cancellation

{
  "storeId": "VALID_STORE_ID",
  "shoppingTripId": "valid-shopping-trip-uuid"
}

Expected Response:

  • Status Code: 200 OK
  • Body: Empty response body

2. Test Case: Unknown Shopping Trip (400 Error)

Objective: Trigger "UnknownShoppingTrip" error

{
  "storeId": "VALID_STORE_ID",
  "shoppingTripId": "invalid-shopping-trip-uuid"
}

Expected Response:

{
  "errorMsg": "UnknownShoppingTrip"
}

3. Test Case: Bad Request - Invalid Store ID (400 Error)

Objective: Trigger "BadRequestException" for invalid storeId

{
  "storeId": "INVALID@STORE#ID",
  "shoppingTripId": "valid-shopping-trip-uuid"
}

Expected Response:

{
  "errorMsg": "BadRequestException"
}

4. Test Case: Bad Request - Missing Required Fields (400 Error)

Objective: Trigger "BadRequestException" for missing storeId

{
  "shoppingTripId": "valid-shopping-trip-uuid"
}

Expected Response:

{
  "errorMsg": "BadRequestException"
}

5. Test Case: Bad Request - Missing Shopping Trip ID (400 Error)

Objective: Trigger "BadRequestException" for missing shoppingTripId

{
  "storeId": "VALID_STORE_ID"
}

Expected Response:

{
  "errorMsg": "BadRequestException"
}

6. Test Case: Bad Request - Invalid Data Types (400 Error)

Objective: Trigger "BadRequestException" for incorrect data types

{
  "storeId": 12345,
  "shoppingTripId": true
}

Expected Response:

{
  "errorMsg": "BadRequestException"
}

7. Test Case: StoreId Format Validation (400 Error)

Objective: Test storeId pattern validation ^[0-9a-zA-Z_-]*$

{
  "storeId": "invalid@store#id!",
  "shoppingTripId": "valid-shopping-trip-uuid"
}

Expected Response:

{
  "errorMsg": "BadRequestException"
}

8. Test Case: ShoppingTripId Format Validation (400 Error)

Objective: Test shoppingTripId pattern validation ^[0-9a-zA-Z_-]+$

{
  "storeId": "VALID_STORE_ID",
  "shoppingTripId": "invalid@trip#id!"
}

Expected Response:

{
  "errorMsg": "BadRequestException"
}

9. Test Case: Field Length Validation (400 Error)

Objective: Test field length limits (> 255 characters)

{
  "storeId": "A".repeat(256),
  "shoppingTripId": "valid-shopping-trip-uuid"
}

Expected Response:

{
  "errorMsg": "BadRequestException"
}

10. Test Case: Rate Limiting (429 Error)

Objective: Trigger "Too Many Requests" error

Test Method: Send multiple rapid requests to exceed rate limit

Expected Response:

{
  "errorMsg": "Too Many Requests"
}

Headers: Retry-After: 600

11. Test Case: Server Error (500 Error)

Objective: Trigger "ServiceException"

Test Method: This typically occurs during server issues or unhandled exceptions

Expected Response:

{
  "errorMsg": "ServiceException"
}

12. Test Case: Service Unavailable (503 Error)

Objective: Trigger "ServiceUnavailableException"

Test Method: Send request during maintenance or service downtime

Expected Response:

{
  "errorMsg": "Service temporarily unavailable",
  "retryAfter": "300"
}

13. Test Case: Empty String Values (400 Error)

Objective: Test empty string validation

{
  "storeId": "",
  "shoppingTripId": ""
}

14. Test Case: Null Values (400 Error)

Objective: Test null value handling

{
  "storeId": null,
  "shoppingTripId": null
}

15. Test Case: Whitespace Only Values (400 Error)

Objective: Test whitespace validation

{
  "storeId": "   ",
  "shoppingTripId": "   "
}