springBoot-test知识集合

@profile

  通过设定环境的activeProfile来设置当前上下文所需要的配置环境,在开发中使用@profile或activeProfile注解或方法,来达到 不同环境实例化不同bean。

@DirtiesContext

  test执行结束后清空缓存(可解决很多莫名其妙错误。)

posted on 2020-06-17 10:57  水日  阅读(94)  评论(0)    收藏  举报

导航