Prevent SpringBootApplication starting to overlap with user defined Application.
Fixes #1391 Resolves #1393
This commit is contained in:
committed by
Oleg Zhurakousky
parent
3ebea011bf
commit
66b7d8dbe4
@@ -36,7 +36,7 @@ import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||
import org.springframework.cache.support.NoOpCacheManager;
|
||||
import org.springframework.cloud.stream.binder.BinderHeaders;
|
||||
import org.springframework.cloud.stream.schema.SchemaReference;
|
||||
@@ -67,8 +67,9 @@ public class AvroMessageConverterSerializationTests {
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
schemaRegistryServerContext = SpringApplication
|
||||
.run(SchemaRegistryServerApplication.class);
|
||||
schemaRegistryServerContext = new SpringApplicationBuilder(SchemaRegistryServerApplication.class)
|
||||
.properties("spring.config.name=schemaregistryserver")
|
||||
.run();
|
||||
}
|
||||
|
||||
@After
|
||||
|
||||
@@ -26,6 +26,7 @@ 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;
|
||||
@@ -57,8 +58,10 @@ public class AvroSchemaRegistryClientMessageConverterTests {
|
||||
@Test
|
||||
public void testSendMessage() throws Exception {
|
||||
|
||||
ConfigurableApplicationContext schemaRegistryServerContext = SpringApplication.run(
|
||||
SchemaRegistryServerApplication.class);
|
||||
ConfigurableApplicationContext schemaRegistryServerContext =
|
||||
new SpringApplicationBuilder(SchemaRegistryServerApplication.class)
|
||||
.properties("spring.config.name=schemaregistryserver")
|
||||
.run();
|
||||
|
||||
ConfigurableApplicationContext sourceContext = SpringApplication.run(AvroSourceApplication.class,
|
||||
"--server.port=0",
|
||||
|
||||
Reference in New Issue
Block a user