Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
o-shevchenko committed Apr 19, 2024
1 parent 9f8208c commit d125ecc
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit.jupiter.SpringExtension;
import org.springframework.util.unit.DataSize;

/**
* Tests whether the global property fallback works.
Expand All @@ -34,6 +35,8 @@
@SpringBootTest(properties = {
"grpc.client.GLOBAL.keepAliveTime=23m",
"grpc.client.GLOBAL.keepAliveTimeout=31s",
"grpc.client.GLOBAL.maxInboundMessageSize=5MB",
"grpc.client.GLOBAL.maxInboundMetadataSize=3MB",
"grpc.client.test.keepAliveTime=42m"})
class GrpcChannelPropertiesGlobalTest {

Expand All @@ -52,4 +55,11 @@ void test() {
assertEquals(Duration.ofSeconds(31), this.grpcChannelsProperties.getChannel("test").getKeepAliveTimeout());
}

@Test
void testCopyDefaults() {
assertEquals(DataSize.ofMegabytes(5),
this.grpcChannelsProperties.getChannel("test").getMaxInboundMessageSize());
assertEquals(DataSize.ofMegabytes(3),
this.grpcChannelsProperties.getChannel("test").getMaxInboundMetadataSize());
}
}

0 comments on commit d125ecc

Please sign in to comment.