-
Notifications
You must be signed in to change notification settings - Fork 238
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
Support for requestPays in java-storage call flow #995
base: master
Are you sure you want to change the base?
Conversation
/gcbrun |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #995 +/- ##
============================================
+ Coverage 76.73% 82.39% +5.65%
- Complexity 1640 1782 +142
============================================
Files 101 101
Lines 7935 7946 +11
Branches 990 992 +2
============================================
+ Hits 6089 6547 +458
+ Misses 1409 1002 -407
+ Partials 437 397 -40
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@@ -51,7 +51,7 @@ | |||
@VisibleForTesting | |||
public class GoogleCloudStorageClientImpl extends ForwardingGoogleCloudStorage { | |||
private static final GoogleLogger logger = GoogleLogger.forEnclosingClass(); | |||
|
|||
private static GoogleCloudStorageImpl delegate; |
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.
make this final?
@@ -51,7 +51,7 @@ | |||
@VisibleForTesting | |||
public class GoogleCloudStorageClientImpl extends ForwardingGoogleCloudStorage { | |||
private static final GoogleLogger logger = GoogleLogger.forEnclosingClass(); | |||
|
|||
private static GoogleCloudStorageImpl delegate; |
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.
Why is this static?
@@ -51,7 +51,7 @@ | |||
@VisibleForTesting | |||
public class GoogleCloudStorageClientImpl extends ForwardingGoogleCloudStorage { | |||
private static final GoogleLogger logger = GoogleLogger.forEnclosingClass(); | |||
|
|||
private static GoogleCloudStorageImpl delegate; |
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.
Having the base class and derived class having same field is an anti pattern
@@ -160,6 +168,11 @@ public void close() { | |||
} | |||
} | |||
|
|||
@Override | |||
public GoogleCloudStorageImpl getDelegate() { |
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.
this is overriding the same method as base class?
|
||
public GoogleCloudStorageClientWriteChannel( | ||
Storage storage, | ||
GoogleCloudStorageOptions storageOptions, | ||
StorageResourceId resourceId, | ||
CreateObjectOptions createOptions, | ||
boolean requesterPays, |
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.
wont this break the public API? Maybe add a new constructor?
|
||
public GoogleCloudStorageClientWriteChannel( | ||
Storage storage, | ||
GoogleCloudStorageOptions storageOptions, | ||
StorageResourceId resourceId, | ||
CreateObjectOptions createOptions, | ||
boolean requesterPays, |
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.
consider renaming this to something like requesterPaysEnabled or something similar
readChannel = getJavaStorageChannel(DEFAULT_ITEM_INFO, DEFAULT_READ_OPTION); | ||
} | ||
|
||
@Test | ||
public void verifyRequesterPaysOption() 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.
Do we have any integration test for requesterPays?
fakeReadChannel = spy(new FakeReadChannel(CONTENT)); | ||
when(mockedStorage.reader(blobIdCaptor.capture(), blobSourceOptionCaptor.capture())) | ||
.thenReturn(fakeReadChannel); | ||
readChannel = |
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.
what are we really testing here?
No description provided.