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

相关推荐
超级码.里奥.农4 分钟前
零基础 “入坑” Java--- 七、数组(二)
java·开发语言
hqxstudying13 分钟前
Java创建型模式---单例模式
java·数据结构·设计模式·代码规范
挺菜的22 分钟前
【算法刷题记录(简单题)002】字符串字符匹配(java代码实现)
java·开发语言·算法
A__tao22 分钟前
一键将 SQL 转为 Java 实体类,全面支持 MySQL / PostgreSQL / Oracle!
java·sql·mysql
开开心心就好31 分钟前
免费PDF处理软件,支持多种操作
运维·服务器·前端·spring boot·智能手机·pdf·电脑
一只叫煤球的猫33 分钟前
真实事故复盘:Redis分布式锁居然失效了?公司十年老程序员踩的坑
java·redis·后端
猴哥源码36 分钟前
基于Java+SpringBoot的农事管理系统
java·spring boot
面朝大海,春不暖,花不开1 小时前
Java网络编程:TCP/UDP套接字通信详解
java·网络·tcp/ip
慕y2741 小时前
Java学习第十五部分——MyBatis
java·学习·mybatis
A__tao1 小时前
SQL 转 Java 实体类工具
java·数据库·sql