Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
cindy-peng committed Jan 13, 2025
1 parent ed989ea commit 3288890
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,23 @@ public void testDatastore() {
assertSame(datastoreRpc, options.build().getRpc());
}

@Test
public void testGrpcDefaultChannelConfigurations() {
DatastoreOptions datastoreOptions =
DatastoreOptions.newBuilder()
.setServiceRpcFactory(datastoreRpcFactory)
.setProjectId(PROJECT_ID)
.setDatabaseId(DATABASE_ID)
.setTransportOptions(GrpcTransportOptions.newBuilder().build())
.setCredentials(NoCredentials.getInstance())
.setHost("http://localhost:" + PORT)
.build();
ChannelPoolSettings channelPoolSettings = ((InstantiatingGrpcChannelProvider) datastoreOptions.getTransportChannelProvider()).getChannelPoolSettings();
assertEquals(channelPoolSettings.getInitialChannelCount(), 1);
assertEquals(channelPoolSettings.getMinChannelCount(), 1);
assertEquals(channelPoolSettings.getMaxChannelCount(), 4);
}

@Test
public void testCustomChannelAndCredentials() {
InstantiatingGrpcChannelProvider channelProvider =
Expand Down

0 comments on commit 3288890

Please sign in to comment.