Skip to content

Commit d125ecc

Browse files
committedApr 19, 2024
add test
1 parent 9f8208c commit d125ecc

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed
 

‎grpc-client-spring-boot-starter/src/test/java/net/devh/boot/grpc/client/config/GrpcChannelPropertiesGlobalTest.java

+10
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import org.springframework.beans.factory.annotation.Autowired;
2727
import org.springframework.boot.test.context.SpringBootTest;
2828
import org.springframework.test.context.junit.jupiter.SpringExtension;
29+
import org.springframework.util.unit.DataSize;
2930

3031
/**
3132
* Tests whether the global property fallback works.
@@ -34,6 +35,8 @@
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"})
3841
class 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
}

0 commit comments

Comments
 (0)
Please sign in to comment.