Schema Registry cleanup

* AutoConfiguration.imports in-lieu of spring.factories and related changes.
* Build script cleanup.
This commit is contained in:
Soby Chacko
2022-10-31 11:52:06 -04:00
parent ecddd62fad
commit fad684c2d7
5 changed files with 5 additions and 9 deletions

View File

@@ -4,10 +4,10 @@ if [ "$#" -eq 1 ]; then
ARGVALUE=$1
if [[ $ARGVALUE == *"skipTest"* ]]; then
echo "Skippping Tests"
./mvnw clean install -f core/pom.xml -DskipTests
./mvnw clean install -f schema-registry/pom.xml -DskipTests
elif [[ $ARGVALUE == *"disable.checks"* ]]; then
echo "Skippping checkstyle checks"
./mvnw clean install -f core/pom.xml -Ddisable.checks=true
./mvnw clean install -f schema-registry/pom.xml -Ddisable.checks=true
fi
else
./mvnw clean install -f schema-registry/pom.xml

View File

@@ -41,8 +41,8 @@ import org.springframework.util.ReflectionUtils;
*/
@Configuration(proxyBeanMethods = false)
@ConditionalOnClass(name = "org.apache.avro.Schema")
@ConditionalOnProperty(value = "spring.cloud.schemaRegistryClient.enabled", matchIfMissing = true)
@ConditionalOnBean(type = "org.springframework.cloud.stream.schema.registry.client.SchemaRegistryClient")
@ConditionalOnProperty(value = "spring.cloud.stream.schemaRegistryClient.enabled", matchIfMissing = true)
@ConditionalOnBean(SchemaRegistryClient.class)
@EnableConfigurationProperties({ AvroMessageConverterProperties.class })
@Import(AvroSchemaServiceManagerImpl.class)
public class AvroMessageConverterAutoConfiguration {

View File

@@ -1,3 +1 @@
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
org.springframework.cloud.stream.schema.registry.avro.AvroMessageConverterAutoConfiguration

View File

@@ -198,7 +198,7 @@ public class AvroSchemaRegistryClientMessageConverterTests {
@Bean
ServletWebServerFactory servletWebServerFactory() {
return new TomcatServletWebServerFactory();
return new TomcatServletWebServerFactory(0);
}
}

View File

@@ -71,9 +71,7 @@ import static org.springframework.test.annotation.DirtiesContext.ClassMode.AFTER
* @author Christian Tzolov
*/
@ExtendWith(SpringExtension.class)
// @checkstyle:off
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT, properties = "spring.main.allow-bean-definition-overriding=true")
// @checkstyle:on
@DirtiesContext(classMode = AFTER_EACH_TEST_METHOD)
public class SchemaRegistryServerAvroTests {