Skip to content

Commit 3feac04

Browse files
Remove warn-unused-config-enabled configuration (#116)
* Remove warn-unused-config-enabled configuration - Remove warnUnusedConfigEnabled property from GrpcClientProperties - Remove grpcClientUnusedConfigChecker bean from GrpcClientAutoConfiguration - Delete Checker class as it's no longer needed - Remove related test cases - This feature became less meaningful with the introduction of ManagedChannels Fixes #113 * regen doc
1 parent 8d064e9 commit 3feac04

File tree

5 files changed

+0
-107
lines changed

5 files changed

+0
-107
lines changed

grpc-boot-autoconfigure/grpc-client-boot-autoconfigure/src/main/java/grpcstarter/client/Checker.java

Lines changed: 0 additions & 80 deletions
This file was deleted.

grpc-boot-autoconfigure/grpc-client-boot-autoconfigure/src/main/java/grpcstarter/client/GrpcClientAutoConfiguration.java

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
package grpcstarter.client;
22

3-
import static grpcstarter.client.Checker.checkUnusedConfig;
4-
53
import grpcstarter.server.GrpcServerShutdownEvent;
64
import org.springframework.beans.factory.BeanFactory;
75
import org.springframework.beans.factory.DisposableBean;
86
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
9-
import org.springframework.boot.CommandLineRunner;
107
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
118
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
129
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
@@ -54,15 +51,6 @@ public ManagedChannels grpcClientManagedChannels(
5451
return new ManagedChannelsImpl(beanFactory, grpcClientProperties);
5552
}
5653

57-
@Bean
58-
@ConditionalOnProperty(
59-
prefix = GrpcClientProperties.PREFIX,
60-
name = "warn-unused-config-enabled",
61-
matchIfMissing = true)
62-
public CommandLineRunner grpcClientUnusedConfigChecker(GrpcClientProperties properties) {
63-
return args -> checkUnusedConfig(properties);
64-
}
65-
6654
@Configuration(proxyBeanMethods = false)
6755
@ConditionalOnClass(RefreshScopeRefreshedEvent.class)
6856
static class RefreshConfiguration {

grpc-boot-autoconfigure/grpc-client-boot-autoconfigure/src/main/java/grpcstarter/client/GrpcClientProperties.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,6 @@ public class GrpcClientProperties implements InitializingBean {
150150
* Refresh configuration.
151151
*/
152152
private Refresh refresh = new Refresh();
153-
/**
154-
* Whether to enable warn unused config, default true.
155-
*/
156-
private boolean warnUnusedConfigEnabled = true;
157153

158154
@Override
159155
public void afterPropertiesSet() {

grpc-boot-autoconfigure/grpc-client-boot-autoconfigure/src/test/java/grpcstarter/client/GrpcClientAutoConfigurationTest.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import static org.assertj.core.api.Assertions.assertThat;
44

55
import org.junit.jupiter.api.Test;
6-
import org.springframework.boot.CommandLineRunner;
76
import org.springframework.boot.autoconfigure.AutoConfigurations;
87
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
98

@@ -20,7 +19,6 @@ void testDefault() {
2019
runner.run(context -> {
2120
assertThat(context).hasSingleBean(GrpcStubBeanDefinitionRegistry.class);
2221
assertThat(context).hasSingleBean(GrpcClientOptionsClientInterceptor.class);
23-
assertThat(context).getBean("grpcClientUnusedConfigChecker").isInstanceOf(CommandLineRunner.class);
2422
assertThat(context).hasSingleBean(ShutdownEventBasedChannelCloser.class);
2523

2624
assertThat(context).doesNotHaveBean(GrpcClientRefreshScopeRefreshedEventListener.class);
@@ -38,12 +36,4 @@ void testClientEnabled() {
3836
assertThat(context).doesNotHaveBean(GrpcClientProperties.class);
3937
});
4038
}
41-
42-
@Test
43-
void whenWarnUnusedConfigDisabled_thenNoUnusedConfigCheckerBean() {
44-
runner.withPropertyValues("grpc.client.warn-unused-config-enabled=false")
45-
.run(context -> {
46-
assertThat(context).doesNotHaveBean("grpcClientUnusedConfigChecker");
47-
});
48-
}
4939
}

website/docs/40-configuration-properties.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ This page was generated by [spring-configuration-property-documenter](https://gi
108108
| metadata| java.util.List<grpcstarter.client.GrpcClientProperties$Metadata>| | | |
109109
| shutdown-timeout| java.lang.Long| | | |
110110
| ssl-bundle| java.lang.String| | | |
111-
| warn-unused-config-enabled| java.lang.Boolean| | | |
112111
### grpc.client.in-process
113112
**Class:** `grpcstarter.client.GrpcClientProperties$InProcess`
114113

0 commit comments

Comments
 (0)