diff --git a/google-cloud-clients/google-cloud-contrib/google-cloud-nio/src/test/java/com/google/cloud/storage/contrib/nio/it/ITGcsNio.java b/google-cloud-clients/google-cloud-contrib/google-cloud-nio/src/test/java/com/google/cloud/storage/contrib/nio/it/ITGcsNio.java index b99b914d4435..e85febfa31c8 100644 --- a/google-cloud-clients/google-cloud-contrib/google-cloud-nio/src/test/java/com/google/cloud/storage/contrib/nio/it/ITGcsNio.java +++ b/google-cloud-clients/google-cloud-contrib/google-cloud-nio/src/test/java/com/google/cloud/storage/contrib/nio/it/ITGcsNio.java @@ -62,7 +62,6 @@ import org.junit.AfterClass; import org.junit.Assert; import org.junit.BeforeClass; -import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; @@ -157,7 +156,6 @@ private static void fillRequesterPaysFile(Storage storage, String fname, int siz } // Start of tests related to the "requester pays" feature - @Ignore("blocked by #3448") @Test public void testFileExistsRequesterPaysNoUserProject() throws IOException { CloudStorageFileSystem testBucket = getRequesterPaysBucket(false, ""); @@ -187,16 +185,15 @@ public void testFileExistsRequesterPaysWithAutodetect() throws IOException { Files.exists(path); } - @Ignore("blocked by #3448") @Test public void testCantCreateWithoutUserProject() throws IOException { CloudStorageFileSystem testBucket = getRequesterPaysBucket(false, ""); - Path path = testBucket.getPath(SML_FILE); + Path path = testBucket.getPath(TMP_FILE); try { // fails Files.write(path, "I would like to write".getBytes()); Assert.fail("It should have thrown an exception."); - } catch (StorageException ex) { + } catch (IOException ex) { assertIsRequesterPaysException("testCantCreateWithoutUserProject", ex); } } @@ -209,7 +206,6 @@ public void testCanCreateWithUserProject() throws IOException { Files.write(path, "I would like to write, please?".getBytes()); } - @Ignore("blocked by #3448") @Test public void testCantReadWithoutUserProject() throws IOException { CloudStorageFileSystem testBucket = getRequesterPaysBucket(false, ""); @@ -231,7 +227,6 @@ public void testCanReadWithUserProject() throws IOException { Files.readAllBytes(path); } - @Ignore("blocked by #3448") @Test public void testCantCopyWithoutUserProject() throws IOException { CloudStorageFileSystem testRPBucket = getRequesterPaysBucket(false, ""); @@ -324,6 +319,12 @@ private void assertIsRequesterPaysException(String message, StorageException ex) ex.getMessage().contains("Bucket is requester pays bucket but no user project provided")); } + private void assertIsRequesterPaysException(String message, IOException ioex) { + Assert.assertTrue(message, ioex.getMessage().startsWith("400")); + Assert.assertTrue( + message, + ioex.getMessage().contains("Bucket is requester pays bucket but no user project provided")); + } // End of tests related to the "requester pays" feature @Test