解决Spring Boot测试方法Failed to load ApplicationContext问题

解决Spring Boot测试方法Failed to load ApplicationContext问题

**java.lang.IllegalStateException: Failed to load ApplicationContext
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘jdbcController’: Unsatisfied dependency expressed through field ‘dataSource’; nested exception is org.springframework.boot.context.properties.ConfigurationPropertiesBindException: Error creating bean with name ‘getDataSource’: Could not bind properties to ‘DataSource’ : prefix=jdbc, ignoreInvalidFields=false, ignoreUnknownFields=true; nested exception is org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under ‘jdbc.driver’ to java.sql.Driver
Caused by: org.springframework.boot.context.properties.ConfigurationPropertiesBindException: Error creating bean with name ‘getDataSource’: Could not bind properties to ‘DataSource’ : prefix=jdbc, ignoreInvalidFields=false, ignoreUnknownFields=true; nested exception is org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under ‘jdbc.driver’ to java.sql.Driver
Caused by: org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under ‘jdbc.driver’ to java.sql.Driver
Caused by: org.springframework.core.convert.ConverterNotFoundException: No converter found capable of converting from type [java.lang.String] to type [java.sql.Driver]
**
问题就是:DruidDataSource中的连接数据库的key不一致造成的错误
解决Spring Boot测试方法Failed to load ApplicationContext问题
改过之后为:解决Spring Boot测试方法Failed to load ApplicationContext问题