Exclude Rabbit Stream when testing RabbitAutoConfiguration
The stream auto-configuration is tested in RabbitStreamConfigurationTests, and excluding it prevents the creation of the "rabbitStreamEnvironment" Environment bean, which delays the application context close by 1 second because it has to wait for some Netty resources to gracefully shut down. Closes gh-38750
This commit is contained in:
@@ -58,6 +58,7 @@ import org.springframework.amqp.rabbit.retry.MessageRecoverer;
|
||||
import org.springframework.amqp.support.converter.MessageConverter;
|
||||
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigurations;
|
||||
import org.springframework.boot.test.context.FilteredClassLoader;
|
||||
import org.springframework.boot.test.context.assertj.AssertableApplicationContext;
|
||||
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
|
||||
import org.springframework.boot.test.system.CapturedOutput;
|
||||
@@ -104,7 +105,8 @@ import static org.mockito.Mockito.mock;
|
||||
class RabbitAutoConfigurationTests {
|
||||
|
||||
private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
|
||||
.withConfiguration(AutoConfigurations.of(RabbitAutoConfiguration.class));
|
||||
.withConfiguration(AutoConfigurations.of(RabbitAutoConfiguration.class))
|
||||
.withClassLoader(new FilteredClassLoader("org.springframework.rabbit.stream")); // gh-38750
|
||||
|
||||
@Test
|
||||
void testDefaultRabbitConfiguration() {
|
||||
|
||||
Reference in New Issue
Block a user