perf: 收敛工作流状态与高 IO 节点开销

- 落地 Redis 版本状态、触发租约和定义缓存

- 优化数据批写、插件请求、文件下载与审计日志

- 补齐循环范围校验、轮询兼容和专项测试
This commit is contained in:
2026-07-29 00:47:48 +08:00
parent 5ee6065017
commit 1ae8a22afe
103 changed files with 15600 additions and 532 deletions

View File

@@ -0,0 +1,35 @@
package tech.easyflow.log.reporter;
import jakarta.servlet.FilterChain;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import org.junit.Test;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
/**
* {@link ResponseCachingFilter} 路径排除行为测试。
*/
public class ResponseCachingFilterTest {
/**
* 验证 Agent 媒体下载保持原始响应,避免缓存包装器截断异步文件流。
*
* @throws Exception Filter 执行失败
*/
@Test
public void agentMediaDownloadShouldBypassResponseCaching() throws Exception {
HttpServletRequest request = mock(HttpServletRequest.class);
HttpServletResponse response = mock(HttpServletResponse.class);
FilterChain chain = mock(FilterChain.class);
when(request.getMethod()).thenReturn("GET");
when(request.getRequestURI()).thenReturn("/api/v1/agent/media/document/content");
ResponseCachingFilter filter = new ResponseCachingFilter(new ActionLogReporterProperties());
filter.doFilter(request, response, chain);
verify(chain).doFilter(request, response);
}
}