【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 =

相关推荐
大侠归来36 分钟前
C语言素数判断:从入门到进阶
java·c语言·算法
谢亮_vipxieliang40 分钟前
Spring Boot 自动配置原理:从 @SpringBootApplication 到自定义 Starter
java·spring boot·后端
朝朝辞暮i1 小时前
C++ 第 25 课:getter / setter + this
java·javascript·c++
蜗牛互联网1 小时前
Python接入Gemini 3.8 Flash实现票据视觉抽取与规则校验
java·javascript·网络·人工智能·python
用户094248568031 小时前
第22章:JIT编译分层——Interpreter、C1、C2与热点探测
java·jvm
周杰偷奶茶1 小时前
【JavaSE】类和对象基础
java·开发语言
ly76891 小时前
Redis 主从复制全解析:从 PSYNC 协议到复制积压缓冲区的故障切换边界
java·数据库·redis·主从复制·故障切换·psync
Alice-YUE1 小时前
提示词工程:工业级 Prompt 写法与分层组装
java·开发语言·大模型·prompt·提示词工程·system prompt
泡茶喝茶写代码2 小时前
A股量化数据工程:从 REST 接口到策略信号(第 4 篇):行业与概念板块树构建
java·python·股票数据api·股票数据·股票数据api接口·股票api数据接口·股票量化数据api
弹简特2 小时前
【Java项目-企悦抽】17-抽奖模块02-抽奖接口实现
java·开发语言·状态模式·springboot