mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-08-29 03:06:45 +08:00
Fix Bean Condition on GsonTester FactoryBean
This commit fixes the `@ConditionalOnClass` typo on the GsonTester FactoryBean, which was testing for `ObjectMapper` instead of `Gson`. This means that the next condition `@ConditionalOnBean(Gson.class)` throws a `ClassNotFoundException: com.google.gson.Gson` since it's trying to load that class to check for an existing Bean of that type. Fixes gh-6502
This commit is contained in:
parent
c7a23eae56
commit
d62827373d
@ -77,7 +77,7 @@ public class JsonTestersAutoConfiguration {
|
||||
|
||||
@Bean
|
||||
@Scope("prototype")
|
||||
@ConditionalOnClass(ObjectMapper.class)
|
||||
@ConditionalOnClass(Gson.class)
|
||||
@ConditionalOnBean(Gson.class)
|
||||
public FactoryBean<GsonTester<?>> gsonTesterFactoryBean(Gson gson) {
|
||||
return new JsonTesterFactoryBean<GsonTester<?>, Gson>(GsonTester.class, gson);
|
||||
|
Loading…
Reference in New Issue
Block a user