getTask

Configures the behavior of the mocking server to handle Get a Task requests.

This method defines a mock server behavior by simulating the A2A's Get a Task endpoint. It creates a request specification that listens for the "tasks/get" JsonRPC method and includes specific configurations for response behaviors that can be chained using the returned GetTaskBuildingStep instance.

Example usage:

// Configure the mock server to respond with a task
a2aServer.getTask() responds {
id = 1
result {
id = "tid_12345"
sessionId = null
status = TaskStatus(state = "completed")
artifacts = listOf(
Artifact(
name = "joke",
parts = listOf(
TextPart(
text = "This is a joke",
),
),
),
)
}
}

Return

An instance of GetTaskBuildingStep that allows for further configuration of the mock response behavior for "Get a Task" requests.

Parameters

name

An optional identifier for the configured request. This can be used to distinguish between multiple mocked behaviors for "Get a Task" requests.