langchain4j-testing-strategies

仓库创建 2025年10月21日最近提交 1 个月前SkillHot 收录 22 天前
▸ 精选理由

帮助构建可复现的 AI 服务测试,减少生产故障风险。

▸ 风险提示

集成测试依赖 Testcontainers 与 Docker,需网络和容器权限。

这个 Skill 做什么

提供 LangChain4j 的单元、集成与端到端测试策略与 Mock 模式。

为 LangChain4j Java 项目提供一整套测试策略:单元测试用 mock LLM 响应、集成测试用 Testcontainers 启动依赖、以及端到端验证 RAG 和工具执行流程。适合把 AI 服务纳入 CI/CD 或在不调用真实模型的情况下做可靠回归测试。特点是覆盖从快速孤立单测到容器化集成的方案,让 LLM 行为可控且可重现地测试。

▸ 展开 SKILL.md 英文原文

Provides unit test, integration test, and mock AI patterns for LangChain4j applications. Creates mock LLM responses, tests retrieval chains, validates RAG workflows, and implements Testcontainers-based integration tests for Java AI services. Use when unit testing AI services, integration testing LangChain4j components, mocking AI models, or testing LLM-based Java applications.

开发编程测试MockTestcontainers通用
311
Stars
37
Forks
40
仓库内 Skill
+10
7 日增星
安装 / 使用
给你的 Agent 一句话(通用)
帮我安装这个 skill:https://raw.githubusercontent.com/giuseppe-trisciuoglio/developer-kit/main/plugins/developer-kit-java/skills/langchain4j-testing-strategies/SKILL.md
或 curl 直取 SKILL.md
curl -fsSL "https://raw.githubusercontent.com/giuseppe-trisciuoglio/developer-kit/main/plugins/developer-kit-java/skills/langchain4j-testing-strategies/SKILL.md"
SKILL.MD 节选查看完整文件 ↗
# LangChain4J Testing Strategies

## Overview

Patterns for unit testing with mocks, integration testing with Testcontainers, and end-to-end validation of RAG systems, AI Services, and tool execution.

## When to Use

- **Unit testing AI services**: When you need fast, isolated tests for services using LangChain4j AiServices
- **Integration testing LangChain4j components**: When testing real ChatModel, EmbeddingModel, or RAG pipelines with Testcontainers
- **Mocking AI models**: When you need deterministic responses without calling external APIs
- **Testing LLM-based Java applications**: When validating RAG workflows, tool execution, or retrieval chains

## Instructions

### 1. Unit Testing 
via SKILL·HOT · 数据来自 GitHub 公开信息 · 原文版权归作者所有