Skip to content

Commit

Permalink
🦉 Updates from OwlBot post-processor
Browse files Browse the repository at this point in the history
  • Loading branch information
gcf-owl-bot[bot] committed Mar 4, 2022
1 parent d4638ce commit 282faf8
Showing 1 changed file with 3 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
Expand Down Expand Up @@ -279,10 +278,7 @@ private void innerTestCantCopyWithoutUserProject(
// normal StorageException.
} catch (HttpResponseException hex) {
Assert.assertEquals(description, hex.getStatusCode(), 400);
Assert.assertTrue(
description,
hex.getMessage()
.contains("requester pays"));
Assert.assertTrue(description, hex.getMessage().contains("requester pays"));
} catch (StorageException ex) {
assertIsRequesterPaysException(description, ex);
}
Expand Down Expand Up @@ -339,16 +335,12 @@ public void testAutoDetectNoUserProject() throws IOException {

private void assertIsRequesterPaysException(String message, StorageException ex) {
Assert.assertEquals(message, ex.getCode(), 400);
Assert.assertTrue(
message,
ex.getMessage().contains("requester pays"));
Assert.assertTrue(message, ex.getMessage().contains("requester pays"));
}

private void assertIsRequesterPaysException(String message, IOException ioex) {
Assert.assertTrue(message, ioex.getMessage().startsWith("400"));
Assert.assertTrue(
message,
ioex.getMessage().contains("requester pays"));
Assert.assertTrue(message, ioex.getMessage().contains("requester pays"));
}
// End of tests related to the "requester pays" feature

Expand Down

0 comments on commit 282faf8

Please sign in to comment.