M5 AP-003 Adapter-Tests für Timeout und JSON-Request-Inhalt belastbar

gemacht
This commit is contained in:
2026-04-07 00:55:27 +02:00
parent d8d7657a29
commit 167b56bec5
4 changed files with 312 additions and 25 deletions
@@ -277,11 +277,14 @@ public class OpenAiHttpAdapter implements AiInvocationPort {
* The {@link AiRequestRepresentation#sentCharacterCount()} is recorded as audit metadata
* but is <strong>not</strong> used to truncate content in the adapter. The full
* document text is sent to the AI service.
* <p>
* <strong>Package-private for testing:</strong> This method is accessible to tests
* in the same package to verify the actual JSON body structure and content.
*
* @param request the request with prompt and document text
* @return JSON string ready to send in HTTP body
*/
private String buildJsonRequestBody(AiRequestRepresentation request) {
String buildJsonRequestBody(AiRequestRepresentation request) {
JSONObject body = new JSONObject();
body.put("model", apiModel);
body.put("temperature", 0.0);