先记录,再整理
要做单元测试, 目录结构如下(一定要在 test 下面配置上 resoruces,它读取不到 main 中的 resources ):
./src
|-- main
| |-- java
| `-- resources
| |-- application-dev.yaml
| |-- application-local.yaml
| |-- application.yaml
`-- test
|-- java
`-- resources
|-- application-local.yaml
`-- application.yaml
执行指定环境命令:
PS> $ mvn test -D"spring.profiles.active"=local
# 下面这个好像是错误的
# PS> $ mvn test -D"spring-boot.profiles.active"=local
追踪错误信息:
PS> $ mvn test -Dtest=OrderPayB2cServiceTest -DtrimStackTrace=false
单元测试报告可以在根目录下的 target/surefire-reports 看到。还能分日期时间


1681

被折叠的 条评论
为什么被折叠?



