Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

acp-test

Test utilities for unit testing ACP clients and agents without subprocesses or network connections.

Key Classes

Class Purpose
InMemoryTransportPair Creates connected client/agent transports in-process
MockAcpAgent Records requests, provides configurable responses
MockAcpClient Records session updates, handles agent requests

Installation

<dependency>
    <groupId>com.agentclientprotocol</groupId>
    <artifactId>acp-test</artifactId>
    <version>0.9.0</version>
    <scope>test</scope>
</dependency>

Usage

var pair = InMemoryTransportPair.create();

// Build client with one side
AcpSyncClient client = AcpClient.sync(pair.clientTransport()).build();

// Build agent with the other
AcpSyncAgent agent = AcpAgent.sync(pair.agentTransport())
    .initializeHandler(req -> InitializeResponse.ok())
    .promptHandler((req, ctx) -> { /* ... */ })
    .build();

Documentation