Skip to content

Commit 146a3d3

Browse files
authored
test: remove error string matching (#861)
It looks like the text for this error on the backend has changed (sometimes) from "Precondition Failed" to "At least one of the pre-conditions you specified did not hold". I don't think it's really necessary to check the exact message in any case given that we do check for a code of 412, which implies a precondition failure. I added a check of the error Reason instead, which is more standardized. Fixes #853
1 parent f549173 commit 146a3d3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITStorageTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3370,7 +3370,7 @@ public void testBlobReload() throws Exception {
33703370
fail("StorageException was expected");
33713371
} catch (StorageException e) {
33723372
assertEquals(412, e.getCode());
3373-
assertEquals("Precondition Failed", e.getMessage());
3373+
assertEquals("conditionNotMet", e.getReason());
33743374
}
33753375

33763376
Blob updated = blob.reload();

0 commit comments

Comments
 (0)