Skip to content
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

feat: Update Gapic generator and Gax to emit api-versioning via header #2671

Merged
merged 9 commits into from
Apr 26, 2024
Prev Previous commit
Next Next commit
fix: remove redundant var for test.
  • Loading branch information
zhumin8 committed Apr 24, 2024
commit aef94cf540ceaeab86317feb7b884f120e6aab82
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ public class ApiClientHeaderProviderTest {

private static final String X_GOOG_API_CLIENT = "x-goog-api-client";
private static final String CLOUD_RESOURCE_PREFIX = "google-cloud-resource-prefix";
private static final String API_VERSION_HEADER_KEY = "x-goog-api-version";

@Test
public void testServiceHeaderDefault() {
lqiu96 marked this conversation as resolved.
Show resolved Hide resolved
Expand Down Expand Up @@ -145,10 +144,12 @@ public void testApiVersionHeader() {
ApiClientHeaderProvider provider =
ApiClientHeaderProvider.newBuilder().setApiVersionToken("fake-version-string").build();
assertThat(provider.getHeaders().size()).isEqualTo(2);
assertThat(provider.getHeaders().get(API_VERSION_HEADER_KEY)).matches("fake-version-string");
assertThat(provider.getHeaders().get(ApiClientHeaderProvider.API_VERSION_HEADER_KEY))
.matches("fake-version-string");

ApiClientHeaderProvider emptyProvider =
ApiClientHeaderProvider.newBuilder().setApiVersionToken("").build();
assertThat(emptyProvider.getHeaders().get(API_VERSION_HEADER_KEY).isEmpty());
assertThat(
emptyProvider.getHeaders().get(ApiClientHeaderProvider.API_VERSION_HEADER_KEY).isEmpty());
}
}