【SpringBoot】测试Control接口方法

测试Controller接口方法:

执行单元测试:

MockHttpServletRequest:

HTTP Method = POST

Request URI = /hello

Parameters = { }

Headers = [ Content-Type:"application/json;charset=UTF-8"]

Body = null

Session Attrs = { }

Handler:

Type = com.weiz.helloworld.web.HelloContrller

Method = com.weiz.helloworld.web.HelloController#hello()

Async:

Async started =false

Async result = null

Resolved Exception:

Type = null

ModelAndView:

View name = null

View = null

Model = null

FlashMap:

Attributes = null

MockHttpServletResponse:

Status = 200

Error message = null

Headers = [ Content-Type:"text/plain;charset=UTF-8",Content-Length:"17"]

Content type = text/plain;charset=UTF-8

Body = hello Spring Boot

Forward URL = null

Redirected URL = null

Cookies = [ ]

相关推荐
怀旧诚子44 分钟前
timeshift之Fedora43设置,已在VM虚拟机验证,待真机验证。
java·服务器·数据库
1104.北光c°1 小时前
滑动窗口HotKey探测机制:让你的缓存TTL更智能
java·开发语言·笔记·程序人生·算法·滑动窗口·hotkey
云原生指北4 小时前
GitHub Copilot SDK 入门:五分钟构建你的第一个 AI Agent
java
Leinwin8 小时前
OpenClaw 多 Agent 协作框架的并发限制与企业化规避方案痛点直击
java·运维·数据库
薛定谔的悦8 小时前
MQTT通信协议业务层实现的完整开发流程
java·后端·mqtt·struts
enjoy嚣士9 小时前
springboot之Exel工具类
java·spring boot·后端·easyexcel·excel工具类
罗超驿9 小时前
独立实现双向链表_LinkedList
java·数据结构·链表·linkedlist
盐水冰10 小时前
【烘焙坊项目】后端搭建(12) - 订单状态定时处理,来单提醒和顾客催单
java·后端·学习
凸头10 小时前
CompletableFuture 与 Future 对比与实战示例
java·开发语言
wuqingshun31415910 小时前
线程安全需要保证几个基本特征
java·开发语言·jvm