Skip to content

Commit 203e5cd

Browse files
andrey-qlogicchingor13
authored andcommitted
---
yaml --- r: 11357 b: refs/heads/master c: a9a7044 h: refs/heads/master i: 11355: e526a0d
1 parent 4614191 commit 203e5cd

2 files changed

Lines changed: 9 additions & 8 deletions

File tree

  • trunk/google-cloud-clients/google-cloud-contrib/google-cloud-nio/src/test/java/com/google/cloud/storage/contrib/nio/it

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: a6a23024f0328be03ed4f40fed9e5cab8f875e68
2+
refs/heads/master: a9a70442bf6bafbf46c82a76945632a455f2a4c1
33
refs/heads/gh-pages: d1184592f037d21f5ba27914eeda5ea8a3f4a953
44
refs/tags/0.0.9: 22f1839238f66c39e67ed4dfdcd273b1ae2e8444
55
refs/tags/v0.0.10: 207ebd2a3472fddee69fe1298eb90429e3306efd

trunk/google-cloud-clients/google-cloud-contrib/google-cloud-nio/src/test/java/com/google/cloud/storage/contrib/nio/it/ITGcsNio.java

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@
6262
import org.junit.AfterClass;
6363
import org.junit.Assert;
6464
import org.junit.BeforeClass;
65-
import org.junit.Ignore;
6665
import org.junit.Test;
6766
import org.junit.runner.RunWith;
6867
import org.junit.runners.JUnit4;
@@ -157,7 +156,6 @@ private static void fillRequesterPaysFile(Storage storage, String fname, int siz
157156
}
158157

159158
// Start of tests related to the "requester pays" feature
160-
@Ignore("blocked by #3448")
161159
@Test
162160
public void testFileExistsRequesterPaysNoUserProject() throws IOException {
163161
CloudStorageFileSystem testBucket = getRequesterPaysBucket(false, "");
@@ -187,16 +185,15 @@ public void testFileExistsRequesterPaysWithAutodetect() throws IOException {
187185
Files.exists(path);
188186
}
189187

190-
@Ignore("blocked by #3448")
191188
@Test
192189
public void testCantCreateWithoutUserProject() throws IOException {
193190
CloudStorageFileSystem testBucket = getRequesterPaysBucket(false, "");
194-
Path path = testBucket.getPath(SML_FILE);
191+
Path path = testBucket.getPath(TMP_FILE);
195192
try {
196193
// fails
197194
Files.write(path, "I would like to write".getBytes());
198195
Assert.fail("It should have thrown an exception.");
199-
} catch (StorageException ex) {
196+
} catch (IOException ex) {
200197
assertIsRequesterPaysException("testCantCreateWithoutUserProject", ex);
201198
}
202199
}
@@ -209,7 +206,6 @@ public void testCanCreateWithUserProject() throws IOException {
209206
Files.write(path, "I would like to write, please?".getBytes());
210207
}
211208

212-
@Ignore("blocked by #3448")
213209
@Test
214210
public void testCantReadWithoutUserProject() throws IOException {
215211
CloudStorageFileSystem testBucket = getRequesterPaysBucket(false, "");
@@ -231,7 +227,6 @@ public void testCanReadWithUserProject() throws IOException {
231227
Files.readAllBytes(path);
232228
}
233229

234-
@Ignore("blocked by #3448")
235230
@Test
236231
public void testCantCopyWithoutUserProject() throws IOException {
237232
CloudStorageFileSystem testRPBucket = getRequesterPaysBucket(false, "");
@@ -324,6 +319,12 @@ private void assertIsRequesterPaysException(String message, StorageException ex)
324319
ex.getMessage().contains("Bucket is requester pays bucket but no user project provided"));
325320
}
326321

322+
private void assertIsRequesterPaysException(String message, IOException ioex) {
323+
Assert.assertTrue(message, ioex.getMessage().startsWith("400"));
324+
Assert.assertTrue(
325+
message,
326+
ioex.getMessage().contains("Bucket is requester pays bucket but no user project provided"));
327+
}
327328
// End of tests related to the "requester pays" feature
328329

329330
@Test

0 commit comments

Comments
 (0)