Class A2aMockBuilder

java.lang.Object
org.mockserver.client.A2aMockBuilder

public class A2aMockBuilder extends Object
  • Method Details

    • a2aMock

      public static A2aMockBuilder a2aMock()
    • a2aMock

      public static A2aMockBuilder a2aMock(String path)
    • withAgentName

      public A2aMockBuilder withAgentName(String name)
    • withAgentDescription

      public A2aMockBuilder withAgentDescription(String description)
    • withAgentVersion

      public A2aMockBuilder withAgentVersion(String version)
    • withAgentUrl

      public A2aMockBuilder withAgentUrl(String url)
    • withAgentCardPath

      public A2aMockBuilder withAgentCardPath(String path)
    • withDefaultTaskResponse

      public A2aMockBuilder withDefaultTaskResponse(String response)
    • withStreaming

      public A2aMockBuilder withStreaming()
      Advertise and mock the A2A streaming capability. When enabled the agent card reports capabilities.streaming: true and a streaming JSON-RPC method (default message/stream, see withStreamingMethod(String)) returns an SSE stream of TaskStatusUpdateEvent and TaskArtifactUpdateEvent chunks, each wrapped in a JSON-RPC 2.0 response envelope.
    • withStreamingMethod

      public A2aMockBuilder withStreamingMethod(String method)
      Override the JSON-RPC method that triggers the streaming response. The A2A specification uses message/stream; the legacy method name is tasks/sendSubscribe. Implies withStreaming().
    • withPushNotifications

      public A2aMockBuilder withPushNotifications(String webhookUrl)
      Advertise and mock A2A push notifications. When configured the agent card reports capabilities.pushNotifications: true, the tasks/pushNotificationConfig/set method echoes the registered config, and each tasks/send additionally POSTs the completed task (the A2A push-notification payload) to the supplied webhook URL while still returning the JSON-RPC task response to the caller.
      Parameters:
      webhookUrl - absolute webhook URL (e.g. http://localhost:1234/a2a/callback)
    • withSkill

      public A2aMockBuilder.A2aSkillBuilder withSkill(String id)
    • onTaskSend

    • applyTo

      public Expectation[] applyTo(MockServerClient client)
    • build

      public Expectation[] build()