spring boot
文章平均质量分 60
topEngineerr
个人邮箱drstime@163.com。欢迎交流。
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Mock bean失败一直为null
原来的代码如下: @Component public class TargetChargeFinder { @Autowired ChargeRepository chargeRepository; mock beanchargeRepository一直失败,且其值一直为null。原因在于,测试的地方,对于TargetChargeFinder没有采取注入的方式加入测试类当中,而是new的 private TargetChargeFinder finder;..原创 2021-04-15 16:34:11 · 5385 阅读 · 0 评论 -
spring boot入门介绍及自动配置实现原理
Table of Contents Spring Boot是什么? Spring Boot Starter 约定1:项目结构层面的约定 约定2:springMVC框架层面的约定和定制 约定3:嵌入式web容器层面的约定和定制 Automatically Configuration 关于@SpringBootApplication这个注解 @Configuration @Comp...原创 2018-08-20 23:38:08 · 556 阅读 · 0 评论 -
spring boot test 端口号一直为0
用springboot 2.2和junit5时,我需要完成一些integrationtest.在写integrationtest时我有如下的代码用于启动一个测试环境: import org.junit.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot....原创 2020-09-29 16:38:12 · 812 阅读 · 0 评论 -
RestTemplate如何使用get请求获取一个list
假设我们有class定义如下: @JsonIgnoreProperties(ignoreUnknown = true) public class Rate { private String name; private String code; private Double rate; // add getters and setters } 同时我们定义了一个api返回这个类型的object的list,例如: public ResponseEntity<Li.原创 2020-09-21 17:36:23 · 3235 阅读 · 0 评论
分享