mirror of
https://gitee.com/mateos/mateclaw.git
synced 2026-09-13 11:13:43 +08:00
Adds WebChatAttachmentE2ETest — second HTTP-level test in the webchat suite. Boots RANDOM_PORT, drives Spring's multipart parser for real, and verifies the cross-endpoint wiring that turns an upload into an agent-addressable attachment. Coverage (7 tests): - upload + /stream round-trip: persisted user message's content_parts carries the file part with a server path that points into the conversation's upload dir; bytes on disk match what was uploaded - unknown attachmentId → silently dropped (no error, text-only parts) - foreign visitor cannot reference another visitor's fileId (consume() is conversation-scoped) - upload without visitorToken → HTTP 401 - upload with disallowed extension → HTTP 400 - GET /files streams back the uploaded bytes - GET /files without visitorToken → HTTP 401 AgentService is @MockBean'd so /stream returns instantly; what we assert is the persisted user-message shape (DB row content_parts), not the agent's actual file consumption (which would need a real agent + tool runtime — out of scope for the wire-format focus). Worth noting: RHttpStatusAdvice maps R.fail(401/400) to the matching HTTP status, so 4xx assertions are on the HTTP status, not the body. Stack: feat/webchat-stream-e2e-test → feat/webchat-attachment-e2e Follow-up to PR #363. |
||
|---|---|---|
| .. | ||
| src | ||
| Dockerfile | ||
| pom.xml | ||
| settings.xml | ||