Interface RequestMatcher

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface RequestMatcher
Request Matcher — predicate for matching incoming HTTP requests in TestHttpServer. 请求匹配器 — 用于在 TestHttpServer 中匹配传入 HTTP 请求的谓词。

Features | 主要功能:

  • HTTP request matching predicates - HTTP请求匹配谓词
  • Method and path matching - 方法和路径匹配

Usage Examples | 使用示例:

RequestMatcher matcher = RequestMatcher.get("/api/users");
server.when(matcher).thenRespond(MockResponse.ok());

Security | 安全性:

  • Thread-safe: Yes (stateless) - 线程安全: 是(无状态)
Since:
JDK 25, opencode-base-test V1.0.0
Author:
Leon Soo www.LeonSoo.com
See Also: