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

相关推荐
Porunarufu2 分钟前
JAVA·类和对象③封装及包
java·开发语言
咖啡Beans4 分钟前
SpringBoot集成MongoDB使用
spring boot·mongodb
霍小毛6 分钟前
Kubernetes云平台管理实战:滚动升级与秒级回滚
java·容器·kubernetes
代码充电宝16 分钟前
LeetCode 算法题【简单】20. 有效的括号
java·算法·leetcode·面试·职场和发展
q_191328469525 分钟前
基于RuoYi框架+Mysql的汽车进销存后台管理系统
数据库·vue.js·spring boot·mysql·汽车·个人开发·若依
祈祷苍天赐我java之术27 分钟前
Redis 的原子性操作
java·redis
wdfk_prog29 分钟前
klist 迭代器初始化:klist_iter_init_node 与 klist_iter_init
java·前端·javascript
凸头32 分钟前
Collections.synchronizedList()详解
java
用户02738518402639 分钟前
【Android】MotionLayout详解
java·程序员
Jammingpro40 分钟前
【Git版本控制】Git初识、安装、仓库初始化与仓库配置(含git init、git config与配置无法取消问题)
java·git·elasticsearch