Add auto-configuration test for configurer
Signed-off-by: Chris Bono <chris.bono@gmail.com>
This commit is contained in:
@@ -134,6 +134,22 @@ class GrpcServerAutoConfigurationTests {
|
||||
.containsExactly(this.serviceDefinition));
|
||||
}
|
||||
|
||||
@Test
|
||||
void whenHasUserDefinedGrpcServiceConfigurerDoesNotAutoConfigureBean() {
|
||||
GrpcServiceConfigurer customGrpcServiceConfigurer = mock(GrpcServiceConfigurer.class);
|
||||
this.contextRunner()
|
||||
.withBean("customGrpcServiceConfigurer", GrpcServiceConfigurer.class, () -> customGrpcServiceConfigurer)
|
||||
.run((context) -> assertThat(context).getBean(GrpcServiceConfigurer.class)
|
||||
.isSameAs(customGrpcServiceConfigurer));
|
||||
}
|
||||
|
||||
@Test
|
||||
void grpcServiceConfigurerAutoConfiguredAsExpected() {
|
||||
this.contextRunnerWithLifecyle()
|
||||
.run((context) -> assertThat(context).getBean(GrpcServiceConfigurer.class)
|
||||
.isInstanceOf(DefaultGrpcServiceConfigurer.class));
|
||||
}
|
||||
|
||||
@Test
|
||||
void whenHasUserDefinedServerBuilderCustomizersDoesNotAutoConfigureBean() {
|
||||
ServerBuilderCustomizers customCustomizers = mock(ServerBuilderCustomizers.class);
|
||||
|
||||
Reference in New Issue
Block a user