API Testing · Senior · Question 53 of 75

How do you test time-dependent API behaviour like token expiry deterministically?

Show the answer

Correct answer: Inject a controllable clock or short test-only lifetimes

Explanation

Controlled time makes expiry, scheduling and daylight saving tests fast and repeatable.

Further reading

Problem with a question

API Testing · Senior · question 53

Test yourself

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

Take this quiz