Skip to content

test(showcase): add integration tests for resumable upload - #14307

Closed
whowes wants to merge 1 commit into
whowes/showcase-client-generationfrom
whowes/showcase-resumable-upload-it
Closed

whowes wants to merge 1 commit into
whowes/showcase-client-generationfrom
whowes/showcase-resumable-upload-it

Conversation

@whowes

@whowes whowes commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

Work in progress, not ready for review

@whowes
whowes added this pull request to stack #14308 September 9, 2026 00:10

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new integration test class, ITResumableUpload, to verify the behavior of the generated ResumableUploadServiceClient across various scenarios, including synchronous/asynchronous uploads, multi-chunk uploads, and channel guards. The review feedback suggests a minor improvement to use Files.newInputStream(file) instead of new FileInputStream(file.toFile()) to ensure compatibility with non-default file systems.

UploadMediaRequest request =
UploadMediaRequest.newBuilder().setName("it-client-sync.txt").build();

try (InputStream stream = new FileInputStream(file.toFile())) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Prefer using Files.newInputStream(file) instead of new FileInputStream(file.toFile()). Calling Path.toFile() can throw an UnsupportedOperationException if the Path is associated with a non-default file system (such as an in-memory file system like Jimfs). Using Files.newInputStream(path) is the idiomatic Java NIO.2 approach and ensures compatibility across different FileSystem implementations. This improvement can be applied to all other occurrences in this file (lines 106, 127, 141, 156, and 185).

Suggested change
try (InputStream stream = new FileInputStream(file.toFile())) {
try (InputStream stream = Files.newInputStream(file)) {

@whowes
whowes removed this pull request from stack #14308 September 9, 2026 02:59
@whowes
whowes force-pushed the whowes/showcase-resumable-upload-it branch from bbf4925 to 6f448dc Compare September 9, 2026 03:47
@whowes
whowes force-pushed the whowes/showcase-client-generation branch from 102dc19 to ad3d894 Compare September 9, 2026 03:47
@whowes
whowes added this pull request to stack #14316 September 9, 2026 03:59
@whowes whowes closed this Sep 9, 2026
@whowes
whowes removed this pull request from stack #14316 September 9, 2026 06:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant