diff --git a/spring-cloud-stream-schema-server/src/main/java/org/springframework/cloud/stream/schema/server/SchemaRegistryServerApplication.java b/spring-cloud-stream-schema-server/src/main/java/org/springframework/cloud/stream/schema/server/SchemaRegistryServerApplication.java index 8e9b44b29..76b084281 100644 --- a/spring-cloud-stream-schema-server/src/main/java/org/springframework/cloud/stream/schema/server/SchemaRegistryServerApplication.java +++ b/spring-cloud-stream-schema-server/src/main/java/org/springframework/cloud/stream/schema/server/SchemaRegistryServerApplication.java @@ -16,18 +16,16 @@ package org.springframework.cloud.stream.schema.server; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.builder.SpringApplicationBuilder; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; /** * @author Vinicius Carvalho - * @author Guilherme Blanco */ -@EnableAutoConfiguration +@SpringBootApplication @EnableSchemaRegistryServer public class SchemaRegistryServerApplication { public static void main(String[] args) { - new SpringApplicationBuilder(SchemaRegistryServerApplication.class) - .properties("spring.config.name=schemaregistryserver").run(args); + SpringApplication.run(SchemaRegistryServerApplication.class, args); } } diff --git a/spring-cloud-stream-schema-server/src/main/resources/schemaregistryserver.yml b/spring-cloud-stream-schema-server/src/main/resources/application.yml similarity index 100% rename from spring-cloud-stream-schema-server/src/main/resources/schemaregistryserver.yml rename to spring-cloud-stream-schema-server/src/main/resources/application.yml diff --git a/spring-cloud-stream-schema-server/src/test/java/org/springframework/cloud/stream/schema/server/SchemaRegistryServerAvroTests.java b/spring-cloud-stream-schema-server/src/test/java/org/springframework/cloud/stream/schema/server/SchemaRegistryServerAvroTests.java index ea7e99d6f..c91826c53 100644 --- a/spring-cloud-stream-schema-server/src/test/java/org/springframework/cloud/stream/schema/server/SchemaRegistryServerAvroTests.java +++ b/spring-cloud-stream-schema-server/src/test/java/org/springframework/cloud/stream/schema/server/SchemaRegistryServerAvroTests.java @@ -44,11 +44,7 @@ import static org.springframework.test.annotation.DirtiesContext.ClassMode.AFTER * @author Ilayaperumal Gopinathan */ @RunWith(SpringRunner.class) -@SpringBootTest( - classes = SchemaRegistryServerApplication.class, - properties = {"spring.config.name:schemaregistryserver"}, - webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT -) +@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT) @DirtiesContext(classMode = AFTER_EACH_TEST_METHOD) public class SchemaRegistryServerAvroTests { diff --git a/spring-cloud-stream-schema/src/test/java/org/springframework/cloud/schema/avro/AvroMessageConverterSerializationTests.java b/spring-cloud-stream-schema/src/test/java/org/springframework/cloud/schema/avro/AvroMessageConverterSerializationTests.java index 1cab121db..a75814b21 100644 --- a/spring-cloud-stream-schema/src/test/java/org/springframework/cloud/schema/avro/AvroMessageConverterSerializationTests.java +++ b/spring-cloud-stream-schema/src/test/java/org/springframework/cloud/schema/avro/AvroMessageConverterSerializationTests.java @@ -36,7 +36,7 @@ import org.junit.Assert; import org.junit.Before; import org.junit.Test; -import org.springframework.boot.builder.SpringApplicationBuilder; +import org.springframework.boot.SpringApplication; import org.springframework.cache.support.NoOpCacheManager; import org.springframework.cloud.stream.binder.BinderHeaders; import org.springframework.cloud.stream.schema.SchemaReference; @@ -67,9 +67,8 @@ public class AvroMessageConverterSerializationTests { @Before public void setup() { - schemaRegistryServerContext = new SpringApplicationBuilder(SchemaRegistryServerApplication.class) - .properties("spring.config.name=schemaregistryserver") - .run(); + schemaRegistryServerContext = SpringApplication + .run(SchemaRegistryServerApplication.class); } @After diff --git a/spring-cloud-stream-schema/src/test/java/org/springframework/cloud/schema/avro/AvroSchemaRegistryClientMessageConverterTests.java b/spring-cloud-stream-schema/src/test/java/org/springframework/cloud/schema/avro/AvroSchemaRegistryClientMessageConverterTests.java index da5adb9ca..d89b7767e 100644 --- a/spring-cloud-stream-schema/src/test/java/org/springframework/cloud/schema/avro/AvroSchemaRegistryClientMessageConverterTests.java +++ b/spring-cloud-stream-schema/src/test/java/org/springframework/cloud/schema/avro/AvroSchemaRegistryClientMessageConverterTests.java @@ -26,7 +26,6 @@ import org.junit.Test; import org.springframework.beans.DirectFieldAccessor; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.cache.support.NoOpCacheManager; import org.springframework.cloud.stream.annotation.EnableBinding; import org.springframework.cloud.stream.annotation.StreamListener; @@ -58,10 +57,8 @@ public class AvroSchemaRegistryClientMessageConverterTests { @Test public void testSendMessage() throws Exception { - ConfigurableApplicationContext schemaRegistryServerContext = - new SpringApplicationBuilder(SchemaRegistryServerApplication.class) - .properties("spring.config.name=schemaregistryserver") - .run(); + ConfigurableApplicationContext schemaRegistryServerContext = SpringApplication.run( + SchemaRegistryServerApplication.class); ConfigurableApplicationContext sourceContext = SpringApplication.run(AvroSourceApplication.class, "--server.port=0",