【SpringBoot】Controller与Test

第一个SpringBoot程序:

@RestController

public class HelloController{

@RequestMapping("/hello")

public String hello(){

return "Hello @ Spring Boot!!!";

}

}

单元测试:

@SpringBootTest

public class HelloTest{

@Test

public void hello(){

System.out.println("Hello Spring Boot Test");

}

}

相关推荐
悠仁さん5 分钟前
【C++】set map 使用
java·前端·c++
yuniko-n31 分钟前
【JUC】Thread 内存泄露
java
freejackman32 分钟前
【架构篇】双遍历 + 多栈协同:手撸 SQL 血缘引擎的架构思考
java·大数据·数据库·hive·sql·架构·spark
企业数字化笔记39 分钟前
业务单据怎样接入流程中心?启动条件、实例关联与失败回退
java·spring boot·mysql
挖掘狂人1 小时前
同一个端口能不能被两个程序同时监听?
java·后端·程序员
codigger1 小时前
同一个端口能不能被两个程序同时监听?
java·后端·程序员·编程
西索斯coding1 小时前
qwen3.8-max-0902 和 minimax-m3 改真实仓库差多少?2026 年 50 个缺陷复现实测框架
java·服务器·网络·ai
孤狼GPT1 小时前
ChatGPT、Codex工程实战:Spring Boot的SSE一直在推送,为什么经过Nginx后前端才一次性显示?
spring boot·chatgpt·sse·codex·chatgptplus
2501_933923251 小时前
SpringCloud:OpenFeign快速实现
java·后端·spring cloud·openfeign
denlaku1 小时前
JDK 26 新特性详解
java