Skip to content

Commit b844846

Browse files
committed
code review
closes gh-2402 Signed-off-by: Emanuel Trandafir <emanueltrandafir1993@gmail.com>
1 parent e0b9e73 commit b844846

1 file changed

Lines changed: 18 additions & 13 deletions

File tree

spring-cloud-contract-verifier/src/main/java/org/springframework/cloud/contract/verifier/messaging/noop/NoOpContractVerifierAutoConfiguration.java

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -99,20 +99,25 @@ public ContractVerifierObjectMapper contractVerifierObjectMapper(
9999
return new ContractVerifierObjectMapper(mapper);
100100
}
101101

102-
@Bean
103-
@ConditionalOnMissingBean
102+
@Configuration(proxyBeanMethods = false)
104103
@ConditionalOnClass(name = "org.apache.avro.specific.SpecificRecordBase")
105-
public ContractVerifierObjectMapper avroContractVerifierObjectMapper(
106-
ObjectProvider<JsonMapper> jsonMapper) throws ClassNotFoundException {
107-
JsonMapper mapper = jsonMapper.getIfAvailable(JsonMapper::new).rebuild()
108-
.addMixIn(Class.forName("org.apache.avro.specific.SpecificRecordBase"),
109-
IgnoreAvroMixin.class).build();
110-
return new ContractVerifierObjectMapper(mapper);
111-
}
112-
113-
@JsonIgnoreProperties({ "schema", "specificData", "classSchema", "conversion" })
114-
interface IgnoreAvroMixin {
115-
104+
public static class AvroContractVerifierObjectMapperConfiguration {
105+
106+
@Bean
107+
@ConditionalOnMissingBean
108+
public ContractVerifierObjectMapper avroContractVerifierObjectMapper(
109+
ObjectProvider<JsonMapper> jsonMapper) throws ClassNotFoundException {
110+
JsonMapper mapper = jsonMapper.getIfAvailable(JsonMapper::new).rebuild()
111+
.addMixIn(
112+
Class.forName("org.apache.avro.specific.SpecificRecordBase"),
113+
IgnoreAvroMixin.class).build();
114+
return new ContractVerifierObjectMapper(mapper);
115+
}
116+
117+
@JsonIgnoreProperties({ "schema", "specificData", "classSchema", "conversion" })
118+
interface IgnoreAvroMixin {
119+
120+
}
116121
}
117122

118123
}

0 commit comments

Comments
 (0)