-
Notifications
You must be signed in to change notification settings - Fork 33
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
fix: Requester pays to check reason and fallback to error message validation #841
Conversation
...d-nio/src/main/java/com/google/cloud/storage/contrib/nio/CloudStorageFileSystemProvider.java
Outdated
Show resolved
Hide resolved
@sydney-munro Should the requester pays tests disabled in #825 be re-enabled here to ensure that they pass with this patch? |
yes. Those have been added back plus an additional test. |
@@ -338,18 +327,20 @@ public void testAutodetectWhenNotRequesterPays() throws IOException { | |||
""); | |||
} | |||
|
|||
@Test | |||
public void testAutoDetectNoUserProject() throws IOException { | |||
CloudStorageFileSystem testBucket = getRequesterPaysBucket(false, ""); |
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.
To avoid dealing with this check, we set autodetect to false and then just check the provider value for requesterPays directly.
Fixes a NullPointerException introduced in googleapis#841 which occured when trying to check the the requesterPays status of a file while authenticated with an invalid service account. Refs: googleapis#849, googleapis#841
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
Fixes #824 ☕️
If you write sample code, please follow the samples format.