Skip to content

Commit 1579597

Browse files
committed
Remove references to channel factory in filter
Same as we did for the server factory, but without (yet anyway) adding a factory customizer.
1 parent a3e8665 commit 1579597

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

spring-grpc-core/src/main/java/org/springframework/grpc/client/ClientInterceptorFilter.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,9 @@ public interface ClientInterceptorFilter {
3030
* Determine whether the given {@link ClientInterceptor} should be included for the
3131
* provided {@link GrpcChannelFactory}.
3232
* @param interceptor the client interceptor under consideration.
33-
* @param channelFactory the channel factory in use.
3433
* @return {@code true} if the interceptor should be included; {@code false}
3534
* otherwise.
3635
*/
37-
boolean filter(ClientInterceptor interceptor, GrpcChannelFactory channelFactory);
36+
boolean filter(ClientInterceptor interceptor);
3837

3938
}

spring-grpc-core/src/main/java/org/springframework/grpc/client/DefaultGrpcChannelFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public boolean supports(String target) {
9292

9393
@Override
9494
public boolean supports(ClientInterceptor interceptor) {
95-
return this.interceptorFilter == null || this.interceptorFilter.filter(interceptor, this);
95+
return this.interceptorFilter == null || this.interceptorFilter.filter(interceptor);
9696
}
9797

9898
public void setVirtualTargets(VirtualTargets targets) {

spring-grpc-core/src/test/java/org/springframework/grpc/client/ClientInterceptorsConfigurerTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,8 @@ class WithInterceptorFilter {
177177
@Test
178178
void whenFilterExcludesOneGlobalInterceptor_thenBuilderGetsOnlyAllowedOnes() {
179179
ManagedChannelBuilder<?> builder = Mockito.mock();
180-
ClientInterceptorFilter filter = (interceptor,
181-
__) -> interceptor == GlobalClientInterceptorsConfig.GLOBAL_INTERCEPTOR_BAR;
180+
ClientInterceptorFilter filter = (
181+
interceptor) -> interceptor == GlobalClientInterceptorsConfig.GLOBAL_INTERCEPTOR_BAR;
182182
ClientInterceptorsConfigurerTests.this.contextRunner()
183183
.withUserConfiguration(GlobalClientInterceptorsConfig.class)
184184
.run(context -> {
@@ -194,7 +194,7 @@ void whenFilterExcludesOneGlobalInterceptor_thenBuilderGetsOnlyAllowedOnes() {
194194
@Test
195195
void whenFilterIncludesAllGlobalInterceptors_thenBuilderGetsOnlyAllowedOnes() {
196196
ManagedChannelBuilder<?> builder = Mockito.mock();
197-
ClientInterceptorFilter filter = (interceptor, __) -> true;
197+
ClientInterceptorFilter filter = (interceptor) -> true;
198198
ClientInterceptorsConfigurerTests.this.contextRunner()
199199
.withUserConfiguration(GlobalClientInterceptorsConfig.class)
200200
.run(context -> {

0 commit comments

Comments
 (0)