![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
java
java知识记录
别碰我辣条
这个作者很懒,什么都没留下…
展开
-
SpringBoot集成WebSocket
1. 依赖<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-websocket</artifactId></dependency>2. 配置类@Configurationpublic class WebSocketConfig { @Bean public Serve原创 2021-04-12 18:37:54 · 131 阅读 · 0 评论 -
SpringBoot集成RabbitMQ
1. 依赖<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-amqp</artifactId></dependency>2. 配置spring.application.name=rabbitmqspring.rabbitmq.host=47.96.124.15spring.rabb原创 2021-04-12 18:37:08 · 112 阅读 · 0 评论 -
使用虚拟MVC请求进行单元测试Controller层方法
应用场景:表现层代码在测试时,需要部署服务器,启动服务器测试,对于频繁的测试,由于服务器启动缓慢,测试起来很不方便。spring-test提供了虚拟mvc请求,可以模拟请求进行测试需要jar包:spring-test.jar@ContextConfiguration(locations = {"classpath:applicationContext.xml","classpath:spri...原创 2020-03-03 10:06:37 · 293 阅读 · 0 评论 -
junit的三个注解
@Before:测试方法前执行的方法@Test:测试方法@After:测试方法执行后执行的方法原创 2020-03-02 12:10:57 · 112 阅读 · 0 评论