<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Httptest on Tony Bai</title><link>https://tonybai.com/tags/httptest/</link><description>Recent content in Httptest on Tony Bai</description><generator>Hugo</generator><language>zh-cn</language><copyright>2004-2026 Tony Bai. 版权所有.</copyright><lastBuildDate>Mon, 17 Nov 2025 00:00:00 +0800</lastBuildDate><atom:link href="https://tonybai.com/tags/httptest/index.xml" rel="self" type="application/rss+xml"/><item><title>你的 Go 测试，还停留在“演员对台词”吗？</title><link>https://tonybai.com/2025/11/17/go-testing-journey/</link><pubDate>Mon, 17 Nov 2025 00:00:00 +0800</pubDate><guid>https://tonybai.com/2025/11/17/go-testing-journey/</guid><description>本文永久链接 – https://tonybai.com/2025/11/17/go-testing-journey 大家好，我是Tony Bai。 我想请大家想象一个场景： 周五下午五点，你刚刚修复了一个看似无关紧要的 bug，怀着对周末的憧憬，合并了你的代码。CI/CD 流水线一片绿灯，部署顺利完成。 突然，运维在工作群里 @ 了你：“紧急！新版本上线后，核心的用户注册功能好像挂了！” 你心里...</description></item><item><title>Go语言gRPC服务Handler单元测试详解</title><link>https://tonybai.com/2023/11/25/grpc-handler-unit-testing-in-go/</link><pubDate>Sat, 25 Nov 2023 00:00:00 +0800</pubDate><guid>https://tonybai.com/2023/11/25/grpc-handler-unit-testing-in-go/</guid><description>本文永久链接 – https://tonybai.com/2023/11/25/grpc-handler-unit-testing-in-go 在云原生时代和微服务架构背景下，HTTP和RPC协议成为服务间通信和与客户端交互的两种主要方式。对于Go语言而言，标准库提供了net/http/httptest包，为开发人员提供了便捷的方式来构建服务端HTTP Handler单元测试的测试脚手架代码，而无...</description></item><item><title>单测时尽量用fake object</title><link>https://tonybai.com/2023/04/20/provide-fake-object-for-external-collaborators/</link><pubDate>Thu, 20 Apr 2023 00:00:00 +0800</pubDate><guid>https://tonybai.com/2023/04/20/provide-fake-object-for-external-collaborators/</guid><description>本文永久链接 – https://tonybai.com/2023/04/20/provide-fake-object-for-external-collaborators 1\. 单元测试的难点：外部协作者(external collaborators)的存在 -------------------------------------------- 单元测试是软件开发的一个重要部分，它有助于在开...</description></item></channel></rss>