Skip to content
Merged
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -1662,7 +1662,10 @@ public void testSignUrl()
UnsupportedEncodingException {
EasyMock.replay(storageRpcMock);
ServiceAccountCredentials credentials =
new ServiceAccountCredentials(null, ACCOUNT, privateKey, null, null);
ServiceAccountCredentials.newBuilder()
.setClientEmail(ACCOUNT)
.setPrivateKey(privateKey)
.build();
storage = options.toBuilder().setCredentials(credentials).build().getService();
URL url = storage.signUrl(BLOB_INFO1, 14, TimeUnit.DAYS);
String stringUrl = url.toString();
Expand Down Expand Up @@ -1703,7 +1706,10 @@ public void testSignUrlWithHostName()
UnsupportedEncodingException {
EasyMock.replay(storageRpcMock);
ServiceAccountCredentials credentials =
new ServiceAccountCredentials(null, ACCOUNT, privateKey, null, null);
ServiceAccountCredentials.newBuilder()
.setClientEmail(ACCOUNT)
.setPrivateKey(privateKey)
.build();
storage = options.toBuilder().setCredentials(credentials).build().getService();
URL url =
storage.signUrl(
Expand Down Expand Up @@ -1750,7 +1756,10 @@ public void testSignUrlLeadingSlash()
String blobName = "/b1";
EasyMock.replay(storageRpcMock);
ServiceAccountCredentials credentials =
new ServiceAccountCredentials(null, ACCOUNT, privateKey, null, null);
ServiceAccountCredentials.newBuilder()
.setClientEmail(ACCOUNT)
.setPrivateKey(privateKey)
.build();
storage = options.toBuilder().setCredentials(credentials).build().getService();
URL url =
storage.signUrl(BlobInfo.newBuilder(BUCKET_NAME1, blobName).build(), 14, TimeUnit.DAYS);
Expand Down Expand Up @@ -1792,7 +1801,10 @@ public void testSignUrlLeadingSlashWithHostName()
String blobName = "/b1";
EasyMock.replay(storageRpcMock);
ServiceAccountCredentials credentials =
new ServiceAccountCredentials(null, ACCOUNT, privateKey, null, null);
ServiceAccountCredentials.newBuilder()
.setClientEmail(ACCOUNT)
.setPrivateKey(privateKey)
.build();
storage = options.toBuilder().setCredentials(credentials).build().getService();
URL url =
storage.signUrl(
Expand Down Expand Up @@ -1837,7 +1849,10 @@ public void testSignUrlWithOptions()
UnsupportedEncodingException {
EasyMock.replay(storageRpcMock);
ServiceAccountCredentials credentials =
new ServiceAccountCredentials(null, ACCOUNT, privateKey, null, null);
ServiceAccountCredentials.newBuilder()
.setClientEmail(ACCOUNT)
.setPrivateKey(privateKey)
.build();
storage = options.toBuilder().setCredentials(credentials).build().getService();
URL url =
storage.signUrl(
Expand Down Expand Up @@ -1889,7 +1904,10 @@ public void testSignUrlWithOptionsAndHostName()
UnsupportedEncodingException {
EasyMock.replay(storageRpcMock);
ServiceAccountCredentials credentials =
new ServiceAccountCredentials(null, ACCOUNT, privateKey, null, null);
ServiceAccountCredentials.newBuilder()
.setClientEmail(ACCOUNT)
.setPrivateKey(privateKey)
.build();
storage = options.toBuilder().setCredentials(credentials).build().getService();
URL url =
storage.signUrl(
Expand Down Expand Up @@ -1948,7 +1966,10 @@ public void testSignUrlForBlobWithSpecialChars()
};
EasyMock.replay(storageRpcMock);
ServiceAccountCredentials credentials =
new ServiceAccountCredentials(null, ACCOUNT, privateKey, null, null);
ServiceAccountCredentials.newBuilder()
.setClientEmail(ACCOUNT)
.setPrivateKey(privateKey)
.build();
storage = options.toBuilder().setCredentials(credentials).build().getService();

for (char specialChar : specialChars) {
Expand Down Expand Up @@ -2000,7 +2021,10 @@ public void testSignUrlForBlobWithSpecialCharsAndHostName()
};
EasyMock.replay(storageRpcMock);
ServiceAccountCredentials credentials =
new ServiceAccountCredentials(null, ACCOUNT, privateKey, null, null);
ServiceAccountCredentials.newBuilder()
.setClientEmail(ACCOUNT)
.setPrivateKey(privateKey)
.build();
storage = options.toBuilder().setCredentials(credentials).build().getService();

for (char specialChar : specialChars) {
Expand Down Expand Up @@ -2050,7 +2074,10 @@ public void testSignUrlWithExtHeaders()
UnsupportedEncodingException {
EasyMock.replay(storageRpcMock);
ServiceAccountCredentials credentials =
new ServiceAccountCredentials(null, ACCOUNT, privateKey, null, null);
ServiceAccountCredentials.newBuilder()
.setClientEmail(ACCOUNT)
.setPrivateKey(privateKey)
.build();
storage = options.toBuilder().setCredentials(credentials).build().getService();
Map<String, String> extHeaders = new HashMap<String, String>();
extHeaders.put("x-goog-acl", "public-read");
Expand Down Expand Up @@ -2107,7 +2134,10 @@ public void testSignUrlWithExtHeadersAndHostName()
UnsupportedEncodingException {
EasyMock.replay(storageRpcMock);
ServiceAccountCredentials credentials =
new ServiceAccountCredentials(null, ACCOUNT, privateKey, null, null);
ServiceAccountCredentials.newBuilder()
.setClientEmail(ACCOUNT)
.setPrivateKey(privateKey)
.build();
storage = options.toBuilder().setCredentials(credentials).build().getService();
Map<String, String> extHeaders = new HashMap<String, String>();
extHeaders.put("x-goog-acl", "public-read");
Expand Down Expand Up @@ -2165,7 +2195,10 @@ public void testSignUrlForBlobWithSlashes()
UnsupportedEncodingException {
EasyMock.replay(storageRpcMock);
ServiceAccountCredentials credentials =
new ServiceAccountCredentials(null, ACCOUNT, privateKey, null, null);
ServiceAccountCredentials.newBuilder()
.setClientEmail(ACCOUNT)
.setPrivateKey(privateKey)
.build();
storage = options.toBuilder().setCredentials(credentials).build().getService();

String blobName = "/foo/bar/baz #%20other cool stuff.txt";
Expand Down Expand Up @@ -2208,7 +2241,10 @@ public void testSignUrlForBlobWithSlashesAndHostName()
UnsupportedEncodingException {
EasyMock.replay(storageRpcMock);
ServiceAccountCredentials credentials =
new ServiceAccountCredentials(null, ACCOUNT, privateKey, null, null);
ServiceAccountCredentials.newBuilder()
.setClientEmail(ACCOUNT)
.setPrivateKey(privateKey)
.build();
storage = options.toBuilder().setCredentials(credentials).build().getService();

String blobName = "/foo/bar/baz #%20other cool stuff.txt";
Expand Down