API Testing · Middle · Question 67 of 75

How do you test API behaviour when a downstream service returns invalid JSON?

Show the answer

Correct answer: Stub the dependency with broken JSON and check the error handling

Explanation

The API should return a clear 502 or fallback, log the problem and not crash or return garbage.

Further reading

Problem with a question

API Testing · Middle · question 67

Test yourself

Take the API Testing · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz