如何在本地运行时在我的Spring Boot集成测试案例中排除CloudFoundryServiceInfoCreator的实例化

时间:2019-07-18 10:58:44

标签: spring spring-boot-test

每次尝试在本地运行一些集成测试时,我都会遇到错误..无论如何,当我在本地运行它时,是否可以排除与云相关的实例?

ERROR o.s.boot.SpringApplication               [] [] [] Application startup failed java.util.ServiceConfigurationError: org.springframework.cloud.CloudConnector: Provider org.springframework.cloud.cloudfoundry.CloudFoundryConnector could not be instantiated
at java.util.ServiceLoader.fail(ServiceLoader.java:232)
at java.util.ServiceLoader.access$100(ServiceLoader.java:185)
at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:384)
at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404)
at java.util.ServiceLoader$1.next(ServiceLoader.java:480)
at org.springframework.cloud.CloudFactory.scanCloudConnectors(CloudFactory.java:91)
at org.springframework.cloud.CloudFactory.<init>(CloudFactory.java:35)
at io.pivotal.spring.cloud.config.java.ServiceInfoPropertySourceAdapter.onApplicationEvent(ServiceInfoPropertySourceAdapter.java:41)
at io.pivotal.spring.cloud.config.java.ServiceInfoPropertySourceAdapter.onApplicationEvent(ServiceInfoPropertySourceAdapter.java:26)
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:122)
at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:74)
at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:54)
at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:325)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:296)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1118)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1107)

0 个答案:

没有答案