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) {
501
501
if (this .maxInboundMessageSize == null ) {
502
502
this .maxInboundMessageSize = config .maxInboundMessageSize ;
503
503
}
504
+ if (this .maxInboundMetadataSize == null ) {
505
+ this .maxInboundMetadataSize = config .maxInboundMetadataSize ;
506
+ }
504
507
if (this .negotiationType == null ) {
505
508
this .negotiationType = config .negotiationType ;
506
509
}
Original file line number Diff line number Diff line change 26
26
import org .springframework .beans .factory .annotation .Autowired ;
27
27
import org .springframework .boot .test .context .SpringBootTest ;
28
28
import org .springframework .test .context .junit .jupiter .SpringExtension ;
29
+ import org .springframework .util .unit .DataSize ;
29
30
30
31
/**
31
32
* Tests whether the global property fallback works.
34
35
@ SpringBootTest (properties = {
35
36
"grpc.client.GLOBAL.keepAliveTime=23m" ,
36
37
"grpc.client.GLOBAL.keepAliveTimeout=31s" ,
38
+ "grpc.client.GLOBAL.maxInboundMessageSize=5MB" ,
39
+ "grpc.client.GLOBAL.maxInboundMetadataSize=3MB" ,
37
40
"grpc.client.test.keepAliveTime=42m" })
38
41
class GrpcChannelPropertiesGlobalTest {
39
42
@@ -52,4 +55,11 @@ void test() {
52
55
assertEquals (Duration .ofSeconds (31 ), this .grpcChannelsProperties .getChannel ("test" ).getKeepAliveTimeout ());
53
56
}
54
57
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
+ }
55
65
}
You can’t perform that action at this time.
0 commit comments