mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-09-22 17:35:22 +00: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:
+1
-1
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user