【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");

}

}

相关推荐
deviant-ART1 天前
java注解简写规则
java·后端
邪修king1 天前
Re:Linux系统篇(三十八):进程间通信ChapterSystem V 信号量深度解析|同步互斥、内核源码、C 指针多态、实战代码
java·linux·c语言
文丑颜不良啊1 天前
LeetCode1181~1200题目解析
java·leetcode
释厄6231 天前
矢量词汇向下不向上公理即词汇归位定律——肤浅即表面
java·人工智能·算法·去中心化·1024程序员节
海绵宝宝转agent1 天前
Leetcode100+面经
java·笔记·学习·算法·leetcode·深度优先
会编程的吕洞宾1 天前
Spring Boot 镜像瘦身实战:从 450MB 瘦到 180MB
java·后端·spring
Shaoshing1 天前
LeetCode100 283.移动零
java·数据结构·算法·leetcode
海绵宝宝转agent1 天前
LeetCode100个人题解+java面经总结
java·开发语言·笔记·学习·算法
文丑颜不良啊1 天前
LeetCode1201~1220题目解析
java·leetcode
香蕉大香蕉(06敬畏市场)1 天前
高频八股 · JVM(7):方法区、元空间与字符串常量池
java·jvm·ai·博客·八股·大厂实习