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

相关推荐
文丑颜不良啊8 小时前
LeetCode2761~2780题目解析
java·leetcode
IT枫斗者枫哥9 小时前
子线程断言失败,JUnit 为什么还显示通过?
java·后端
考虑考虑11 小时前
JDK27中的Set.ofLazy
java·后端·java ee
文丑颜不良啊11 小时前
LeetCode2841~2860题目解析
java·leetcode
小南家的青蛙11 小时前
Tomcat与Jetty深度对比
java·tomcat·jetty
乌暮13 小时前
Spring AOP 与 Spring 事务:用大白话彻底理解原理与实践
java·数据库·spring boot·后端·sql·学习·spring
YDS82913 小时前
Small Spring IOC篇:容器事件及其监听器
java·spring
金銀銅鐵13 小时前
带您看懂字节码指令(三):一行加法里有什么
java·jvm
文丑颜不良啊13 小时前
LeetCode2921~2940题目解析
java·leetcode
北漂人Java14 小时前
基于 Spring AI Alibaba WorkFlow 构建 Java 生产级 AI Agent
java·人工智能·spring