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

相关推荐
风吹落叶32577 分钟前
深入解析JVM内存管理与垃圾回收机制
java·开发语言·jvm
叶~璃26 分钟前
人工智能驱动的开发变革
java
悟能不能悟43 分钟前
排查Redis数据倾斜引发的性能瓶颈
java·数据库·redis
Derek_Smart1 小时前
Java线程死亡螺旋:解析与预防策略
java·spring·性能优化
翁正存1 小时前
IDEA测试代码报java file outset source root异常
java·ide·intellij-idea
励志五个月成为嵌入式糕手1 小时前
0819 使用IP多路复用实现TCP并发服务器
java·服务器·tcp/ip
Mi_Manchikkk1 小时前
Java高级面试实战:Spring Boot微服务与Redis缓存整合案例解析
java·spring boot·redis·缓存·微服务·面试
呼啦啦啦啦啦啦啦啦9 小时前
常见的排序算法
java·算法·排序算法
anlogic10 小时前
Java基础 8.18
java·开发语言
练习时长一年11 小时前
AopAutoConfiguration源码阅读
java·spring boot·intellij-idea