The PR changed the batch preview preparation service for files. According to the contract, the build(List<String> fileIds) method must:
BatchPreviewResult with files and failures fields;files exactly as in the input list for all successfully processed files;fileId -> error message pair in failures for each unsuccessful file.You need to review the PR changes and find problems in the implementation relative to this contract.
Assumptions and run conditions:
PreviewGateway that throws an exception for some fileIds and returns a preview string with different delays for others, then call BatchPreviewService.build(...) with several elements.Java 21, standard library, running in a normal JVM process. No additional dependencies, frameworks, or code generation.
Use line comments to explain the problem, its impact, the fix and how to test it.