|
|
|
@ -32,6 +32,7 @@ import org.springframework.messaging.rsocket.RSocketStrategies;
|
|
|
|
|
import org.springframework.messaging.rsocket.annotation.support.RSocketMessageHandler;
|
|
|
|
|
|
|
|
|
|
import static org.assertj.core.api.Assertions.assertThat;
|
|
|
|
|
import static org.mockito.Mockito.mock;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Tests for {@link RSocketServerAutoConfiguration}.
|
|
|
|
@ -77,6 +78,12 @@ class RSocketServerAutoConfigurationTests {
|
|
|
|
|
.hasSingleBean(RSocketServerBootstrap.class));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
void shoudUseCustomServerBootstrap() {
|
|
|
|
|
contextRunner().withUserConfiguration(CustomServerBootstrapConfig.class).run((context) -> assertThat(context)
|
|
|
|
|
.getBeanNames(RSocketServerBootstrap.class).containsExactly("customServerBootstrap"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private ApplicationContextRunner contextRunner() {
|
|
|
|
|
return new ApplicationContextRunner().withUserConfiguration(BaseConfiguration.class)
|
|
|
|
|
.withConfiguration(AutoConfigurations.of(RSocketServerAutoConfiguration.class));
|
|
|
|
@ -100,4 +107,14 @@ class RSocketServerAutoConfigurationTests {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Configuration(proxyBeanMethods = false)
|
|
|
|
|
static class CustomServerBootstrapConfig {
|
|
|
|
|
|
|
|
|
|
@Bean
|
|
|
|
|
public RSocketServerBootstrap customServerBootstrap() {
|
|
|
|
|
return mock(RSocketServerBootstrap.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|