Skip to content

test(binding-llm): mock Anthropic backend fixture — k3po scenario scripts - #2580

Closed
jfallows wants to merge 0 commit into
developfrom
claude/jolly-hypatia-9iojjc
Closed

jfallows wants to merge 0 commit into
developfrom
claude/jolly-hypatia-9iojjc

Conversation

@jfallows

Copy link
Copy Markdown
Contributor

Description

Adds k3po scenario-script test fixtures for a mock Anthropic backend, mirroring the existing OpenAI mock-backend pattern (.rpt client/server scripts under binding-llm.spec, driven by LlmClientIT/LlmServerIT/NetworkIT/ApplicationIT in binding-llm), plus one bug fix found while exercising it:

  • network/anthropic.streaming and network/anthropic.nonstreaming client/server .rpt scripts (mock Anthropic upstream, SSE and JSON response shapes), plus dedicated network/client.anthropic.streaming and network/client.anthropic.nonstreaming server scripts for LlmClientIT's exclusive use, since LlmClientFactory always encodes a fixed / path regardless of dialect while the shared network fixtures need the real /v1/messages detection path — same split OpenAI's own fixtures already use.
  • application/anthropic.streaming and application/anthropic.nonstreaming client/server .rpt scripts for the application-side round trip.
  • New LlmClientIT/LlmServerIT/NetworkIT/ApplicationIT test methods wiring up the above.
  • fix(binding-llm.spec): give LlmClientIT its own network-side anthropic mock — fixes a path mismatch (/ vs /v1/messages) between the shared network fixture and what LlmClientFactory actually sends, matching the equivalent fix already applied to the OpenAI fixtures.

Stacking

This branch is built on top of #2578 (Anthropic dialect implementation), which is itself stacked on #2577/#2576 — so this diff includes those commits until they merge to develop, at which point this PR's diff will shrink to just the 3 commits at the tip (af9c0f21, 6ef3389b, 5bb5ca1f). Opened now against develop to prove CI passes on the full stack; base will be reset once the underlying PRs merge one at a time.

Test plan

  • ./mvnw license:check -pl incubator/binding-llm,incubator/binding-llm.spec — clean
  • ./mvnw checkstyle:check -pl incubator/binding-llm,incubator/binding-llm.spec — clean
  • ./mvnw verify -pl incubator/binding-llm,incubator/binding-llm.spec,incubator/binding-llm.conf -am — 199/199 unit tests, 11/11 LlmClientIT, 15/15 LlmServerIT

Fixes #2493


🤖 Generated with Claude Code

https://claude.ai/code/session_01HXHtTkxAUq2EYMqxY8jgY8


Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

llm: mock Anthropic backend (test fixture)

1 participant