我尝试了@DataJpaTest来测试我的存储库,但是我的应用程序正在使用Springfox,因此使用Springfox @
EnableSwagger2时,测试执行将失败,并出现以下错误:
java.lang.IllegalStateException: Failed to load ApplicationContext
...
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'documentationPluginsBootstrapper' defined
...
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'webMvcRequestHandlerProvider' defined
...
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'java.util.List' available
该如何解决?否则,将无法使用@DataJpaTest进行切片测试。
码:
Application class:
@SpringBootApplication
@EnableSwagger2
public class CurrencyApplication { <