-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Expose gRPC endpoint from BigQueryEmulator #10779
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose gRPC endpoint from BigQueryEmulator #10779
Conversation
modules/gcloud/src/test/java/org/testcontainers/containers/BigQueryEmulatorContainerTest.java
Outdated
Show resolved
Hide resolved
… that we can connect a BigQueryWriteClient to the table.
6141082 to
ca5fbd7
Compare
| private BigQuery getBigQuery(BigQueryEmulatorContainer container) { | ||
| String url = container.getEmulatorHttpEndpoint(); | ||
| return BigQueryOptions | ||
| .newBuilder() | ||
| .setProjectId(container.getProjectId()) | ||
| .setHost(url) | ||
| .setLocation(url) | ||
| .setCredentials(NoCredentials.getInstance()) | ||
| .build().getService(); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move this method to the end of the file
modules/gcloud/src/test/java/org/testcontainers/containers/BigQueryEmulatorContainerTest.java
Outdated
Show resolved
Hide resolved
modules/gcloud/src/test/java/org/testcontainers/containers/BigQueryEmulatorContainerTest.java
Outdated
Show resolved
Hide resolved
modules/gcloud/src/test/java/org/testcontainers/containers/BigQueryEmulatorContainerTest.java
Outdated
Show resolved
Hide resolved
modules/gcloud/src/test/java/org/testcontainers/containers/BigQueryEmulatorContainerTest.java
Outdated
Show resolved
Hide resolved
| } | ||
|
|
||
| @Test | ||
| void testGrcpEndpoint() throws IOException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you please add an assertion to this test method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Eliassen-Steinar can you add an assertion?
09b8d06 to
ba27f37
Compare
|
Thanks for your contribution, @Eliassen-Steinar ! |
BigQueryEmulator exposes two endpoints, for http and for gRPC, only the http was exposed by BigQueryEmulatorContainer.
The gRPC port needs to be exposed, as BigQueryWriteSettings needs this port to be configured correctly.
Included test case shows configuration setup and validates that it works as expected.