A UUID gives captured test data a practical globally unique name, preventing one file from overwriting another when repeated runs produce many artifacts. section 15.4
Use a UUID when:
- A filename combines stable context, such as a function name, with a generated identifier. section 15.4
- Captured JSON must be written asynchronously so diagnostic storage does not slow the real work. section 15.4
- Tests need to read previously captured inputs from files and reproduce a failing case. section 15.4
A captured search context
A search operation can store its catalog data and query under a path such as test-data/searchBooksByTitle-68e57c85-2213-471a-8442-c4516e83d786.json. The context remains recognizable, while the UUID makes the artifact distinct. section 15.4
Listing 15.18 Console output when triggering the search endpoint
Data for searchBooksByTitle stored in test-data/searchBooksByTitle-68e57c85-2213-471a-8442-c4516e83d786.json
See the generated UUID embedded in the logged path for captured search data. section 15.4









