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: Add ApiVersion Support #2462

Merged
merged 6 commits into from
May 9, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore: Update test cases
  • Loading branch information
lqiu96 committed May 7, 2024
commit 906a09eb4c746ae6794abb6f6180ce2a5b5ea9d2
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ public void testUserAgent() throws IOException {
request.executeUnparsed();
}

public void testSetsApiVersionHeader() {
public void testSetsApiVersionHeader_apiVersionSet() {
String apiVersion = "testVersion";
HttpTransport transport = new MockHttpTransport();
MockGoogleClient client =
Expand All @@ -255,7 +255,7 @@ public void testSetsApiVersionHeader() {
assertEquals(apiVersion, request.getApiVersionHeader());
}

public void testDoesNotSetsApiVersionHeader() {
public void testDoesNotSetsApiVersionHeader_noApiVersionSet() {
HttpTransport transport = new MockHttpTransport();
MockGoogleClient client =
new MockGoogleClient.Builder(transport, ROOT_URL, SERVICE_PATH, JSON_OBJECT_PARSER, null)
Expand All @@ -265,7 +265,7 @@ public void testDoesNotSetsApiVersionHeader() {
assertNull(request.getApiVersionHeader());
}

public void testSetsNullApiVersionHeader() {
public void testNullApiVersionHeader_noApiVersionSet() {
HttpTransport transport = new MockHttpTransport();
MockGoogleClient client =
new MockGoogleClient.Builder(transport, ROOT_URL, SERVICE_PATH, JSON_OBJECT_PARSER, null)
Expand All @@ -276,13 +276,13 @@ public void testSetsNullApiVersionHeader() {
assertNull(request.getApiVersionHeader());
}

public void testSetsEmptyStringApiVersionHeader() {
public void testEmptyStringApiVersionHeader_noApiVersionSet() {
HttpTransport transport = new MockHttpTransport();
MockGoogleClient client =
new MockGoogleClient.Builder(transport, ROOT_URL, SERVICE_PATH, JSON_OBJECT_PARSER, null)
.build();
final AbstractGoogleClientRequest<Void> request =
new MockGoogleClientRequest<>(client, HttpMethods.GET, URI_TEMPLATE, null, Void.class);
new MockGoogleClientRequest<>(client, HttpMethods.GET, URI_TEMPLATE, null, Void.class, "");
assertNull(request.getApiVersionHeader());
}

Expand Down
Loading