摘要: SpringBoot自启动方式 SprinngBoot 有两种启动方式: 1、ApplicationRunner 默认情况 ApplicationRunner 优先级高于CommandLineRunner 可以通过@Order注解来调整优先级 package com.caicai.springboo 阅读全文
posted @ 2021-01-31 16:26 菜菜920 阅读(312) 评论(0) 推荐(0) 编辑
摘要: SpringBoot 单元测试 1、在Spring Boot 项目中Test模块建对于的测试包 2、编写测试类准备工作 编写功能测试类之前,需要先编写一个验证环境测试方法,来验证当前环境是否正常。 编写测试一般需要声明两个注解 SpringBootTest //带有Springboot 引导程序,可 阅读全文
posted @ 2021-01-31 15:59 菜菜920 阅读(281) 评论(0) 推荐(0) 编辑
摘要: Springboot异步任务 1、在编写之前,我们需要在Pom文件种添加 starter-web依赖组件,只有加入这个之后,才可以加入异步服务。 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-b 阅读全文
posted @ 2021-01-31 14:50 菜菜920 阅读(332) 评论(0) 推荐(0) 编辑
摘要: 在Pom.xml里面添加了alibaba的fasterjson组件报错 <!-- 添加依赖插件 https://mvnrepository.com/ --> <dependency> <groupId>com.alibaba</groupId> <artifactId>fastjson</artif 阅读全文
posted @ 2021-01-31 13:46 菜菜920 阅读(2530) 评论(0) 推荐(0) 编辑