File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed
grpc-client-spring-boot-starter/src
main/java/net/devh/boot/grpc/client/config
test/java/net/devh/boot/grpc/client/config Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -501,6 +501,9 @@ public void copyDefaultsFrom(final GrpcChannelProperties config) {
501501 if (this .maxInboundMessageSize == null ) {
502502 this .maxInboundMessageSize = config .maxInboundMessageSize ;
503503 }
504+ if (this .maxInboundMetadataSize == null ) {
505+ this .maxInboundMetadataSize = config .maxInboundMetadataSize ;
506+ }
504507 if (this .negotiationType == null ) {
505508 this .negotiationType = config .negotiationType ;
506509 }
Original file line number Diff line number Diff line change 2626import org .springframework .beans .factory .annotation .Autowired ;
2727import org .springframework .boot .test .context .SpringBootTest ;
2828import org .springframework .test .context .junit .jupiter .SpringExtension ;
29+ import org .springframework .util .unit .DataSize ;
2930
3031/**
3132 * Tests whether the global property fallback works.
3435@ SpringBootTest (properties = {
3536 "grpc.client.GLOBAL.keepAliveTime=23m" ,
3637 "grpc.client.GLOBAL.keepAliveTimeout=31s" ,
38+ "grpc.client.GLOBAL.maxInboundMessageSize=5MB" ,
39+ "grpc.client.GLOBAL.maxInboundMetadataSize=3MB" ,
3740 "grpc.client.test.keepAliveTime=42m" })
3841class GrpcChannelPropertiesGlobalTest {
3942
@@ -52,4 +55,11 @@ void test() {
5255 assertEquals (Duration .ofSeconds (31 ), this .grpcChannelsProperties .getChannel ("test" ).getKeepAliveTimeout ());
5356 }
5457
58+ @ Test
59+ void testCopyDefaults () {
60+ assertEquals (DataSize .ofMegabytes (5 ),
61+ this .grpcChannelsProperties .getChannel ("test" ).getMaxInboundMessageSize ());
62+ assertEquals (DataSize .ofMegabytes (3 ),
63+ this .grpcChannelsProperties .getChannel ("test" ).getMaxInboundMetadataSize ());
64+ }
5565}
You can’t perform that action at this time.
0 commit comments