Sobes.tech
Middle

Imagine you need to test a new GET endpoint that returns ID and name by ID. List the checks from the most to the least priority.

sobes.tech AI

Answer from AI

  1. Verification of successful response with correct ID:

    • Status code 200
    • Response body contains fields id and name with correct values
  2. Verification of handling a non-existent ID:

    • Status code 404 or other, according to the specification
    • Correct error message
  3. Verification of handling an incorrectly formatted ID:

    • For example, a string instead of a number
    • Status code 400 (Bad Request)
  4. Verification of endpoint response time (performance)

  5. Security verification:

    • No leakage of unnecessary data
    • Authorization/authentication if required
  6. Verification of boundary values of ID (e.g., minimum and maximum allowed ID)

  7. Verification that repeated requests with the same ID return the same result

  8. Verification that there are no extra fields in the response

  9. Verification of the correctness of response headers (Content-Type, CORS, etc.)

Example curl request:

curl -X GET "https://api.example.com/resource/123" -H "Accept: application/json"
Imagine you need to test a new GET endpoint that… - sobes.tech