且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在 Spring boot 1.4.0 中为 @DataJpaTest 排除/禁用特定的自动配置?

更新时间:2022-06-19 22:21:32

你试过 @OverrideAutoConfiguration 注释?它说它可用于覆盖 @EnableAutoConfiguration".我假设从那里你可以以某种方式排除 FlywayAutoConfiguration像这样:

Have you tried the @OverrideAutoConfiguration annotation? It says it "can be used to override @EnableAutoConfiguration". I'm assuming that from there you can somehow exclude FlywayAutoConfiguration like so:

@EnableAutoConfiguration(exclude=FlywayAutoConfiguration.class)