***************************
APPLICATION FAILED TO START
***************************
Description:
Parameter 3 of method eurekaRegistration in org.springframework.cloud.netflix.eureka.EurekaClientAutoConfiguration$RefreshableEurekaClientConfiguration required a bean of type 'com.netflix.appinfo.HealthCheckHandler' that could not be found.
- Bean method 'eurekaHealthCheckHandler' not loaded because @ConditionalOnProperty (eureka.client.healthcheck.enabled) did not find property 'eureka.client.healthcheck.enabled'
Action:
Consider revisiting the conditions above or defining a bean of type 'com.netflix.appinfo.HealthCheckHandler' in your configuration.
这是报具体的错误,说eureka.client.healthcheck.enabled参数找不到,这个是有关服务端和客户端心跳的参数。服务器启动的时候没有问题,但是在junit就报这个错误,后面发现配置文件需要通过注解配置文件的方式引入,具体原因后续查查源码。下图: