Skip to content

Commit 3288890

Browse files
committed
Add test
1 parent ed989ea commit 3288890

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

google-cloud-datastore/src/test/java/com/google/cloud/datastore/DatastoreOptionsTest.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,23 @@ public void testDatastore() {
103103
assertSame(datastoreRpc, options.build().getRpc());
104104
}
105105

106+
@Test
107+
public void testGrpcDefaultChannelConfigurations() {
108+
DatastoreOptions datastoreOptions =
109+
DatastoreOptions.newBuilder()
110+
.setServiceRpcFactory(datastoreRpcFactory)
111+
.setProjectId(PROJECT_ID)
112+
.setDatabaseId(DATABASE_ID)
113+
.setTransportOptions(GrpcTransportOptions.newBuilder().build())
114+
.setCredentials(NoCredentials.getInstance())
115+
.setHost("http://localhost:" + PORT)
116+
.build();
117+
ChannelPoolSettings channelPoolSettings = ((InstantiatingGrpcChannelProvider) datastoreOptions.getTransportChannelProvider()).getChannelPoolSettings();
118+
assertEquals(channelPoolSettings.getInitialChannelCount(), 1);
119+
assertEquals(channelPoolSettings.getMinChannelCount(), 1);
120+
assertEquals(channelPoolSettings.getMaxChannelCount(), 4);
121+
}
122+
106123
@Test
107124
public void testCustomChannelAndCredentials() {
108125
InstantiatingGrpcChannelProvider channelProvider =

0 commit comments

Comments
 (0)