Skip to content

Commit 2f928ba

Browse files
andrey-qlogicchingor13
authored andcommitted
---
yaml --- r: 15961 b: refs/heads/autosynth-errorreporting c: a9a7044 h: refs/heads/master i: 15959: 39c9960
1 parent 862c168 commit 2f928ba

2 files changed

Lines changed: 9 additions & 8 deletions

File tree

  • branches/autosynth-errorreporting/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
@@ -131,7 +131,7 @@ refs/heads/autosynth-bigtable-admin: 6379a2bc712f2736c83de0e009b4d26da4fa82ca
131131
refs/heads/autosynth-containeranalysis: 039ca5b8db725c76c16a965ff26b2774322b8ef8
132132
refs/heads/autosynth-datastore: 9acd400b484d6691a080c9152a331d88d24fefc1
133133
refs/heads/autosynth-dialogflow: d7477419376eac9b6dcc7dbcede581152527351d
134-
refs/heads/autosynth-errorreporting: a6a23024f0328be03ed4f40fed9e5cab8f875e68
134+
refs/heads/autosynth-errorreporting: a9a70442bf6bafbf46c82a76945632a455f2a4c1
135135
refs/heads/autosynth-firestore: 92b27fbc8855c9902168695abb0a8f1f433b750b
136136
refs/heads/autosynth-iot: 9d732be07d99843d8cb53d34ec0837328a807fce
137137
refs/heads/autosynth-kms: dcc6e15d68759010c8735cc868135bd7e6c1cc5f

branches/autosynth-errorreporting/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)