Skip to content

Commit e3b136b

Browse files
committed
Remove the netty bean from test
exclude netty dependencies from test
1 parent 685bcb0 commit e3b136b

2 files changed

Lines changed: 5 additions & 13 deletions

File tree

basic/grpc-client/src/test/java/org/springframework/integration/samples/grpc/client/GrpcClientTests.java

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@
2626
import org.springframework.boot.test.system.CapturedOutput;
2727
import org.springframework.boot.test.system.OutputCaptureExtension;
2828
import org.springframework.context.annotation.Bean;
29-
import org.springframework.context.annotation.Primary;
30-
import org.springframework.grpc.server.NettyGrpcServerFactory;
3129
import org.springframework.test.annotation.DirtiesContext;
3230

3331
import static org.assertj.core.api.Assertions.assertThat;
@@ -98,17 +96,6 @@ public void streamHello(HelloRequest request,
9896
}
9997
};
10098
}
101-
102-
/**
103-
* Override the Netty server factory to return null, preventing Netty server creation.
104-
* @return null to disable Netty server
105-
*/
106-
@Bean
107-
@Primary
108-
NettyGrpcServerFactory nettyGrpcServerFactory() {
109-
return null;
110-
}
111-
11299
}
113100

114101
}

build.gradle

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -898,6 +898,11 @@ project('grpc-client') {
898898
//Test
899899
testImplementation 'org.springframework.boot:spring-boot-starter-test'
900900
testImplementation "org.springframework.grpc:spring-grpc-test"
901+
902+
configurations {
903+
testImplementation.exclude group: 'io.grpc', module: 'grpc-netty'
904+
testRuntimeOnly.exclude group: 'io.grpc', module: 'grpc-netty'
905+
}
901906
}
902907

903908

0 commit comments

Comments
 (0)