GoogleCloudStorageExceptions { public static FileNotFoundException createFileNotFoundException( String bucketName, String objectName, @Nullable IOException cause) { checkArgument(!isNullOrEmpty(bucketName), "bucketName must not be null or empty"); FileNotFoundException fileNotFoundException = new FileNotFoundException( String.format( "Item not found: '%s'. Note, it is possible that the live version" + " is still available but the requested generation is deleted.", StringPaths.fromComponents(bucketName, nullToEmpty(objectName)))); if (cause != null) { fileNotFoundException.initCause(cause); } return fileNotFoundException; } private  GoogleCloudStorageExceptions(); static FileNotFoundException createFileNotFoundException(
      String bucketName, String objectName, @Nullable IOException cause); static FileNotFoundException createFileNotFoundException(
      StorageResourceId resourceId, @Nullable IOException cause); static IOException createCompositeException(Collection<IOException> innerExceptions); static GoogleJsonResponseException createJsonResponseException(
      GoogleJsonError e, HttpHeaders responseHeaders);  }
@Test public void testGetFileNotFoundExceptionThrowsWhenBucketNameIsNull() { assertThrows( IllegalArgumentException.class, () -> createFileNotFoundException( null, "obj", null)); }
@Test public void testGetFileNotFoundExceptionThrowsWhenBucketNameIsEmpty() { assertThrows( IllegalArgumentException.class, () -> createFileNotFoundException("", "obj", null)); }
@Test public void testGetFileNotFoundException() { assertThat(createFileNotFoundException("bucket", null, null)) .hasMessageThat() .startsWith("Item not found: 'gs: assertThat(createFileNotFoundException("bucket", "", null)) .hasMessageThat() .startsWith("Item not found: 'gs: assertThat(createFileNotFoundException("bucket", "obj", null)) .hasMessageThat() .startsWith("Item not found: 'gs: }
@Test public void createFileNotFoundException_withCause() { IOException cause = new IOException("cause exception"); FileNotFoundException e = createFileNotFoundException("bucket", "object", cause); assertThat(e).hasCauseThat().isSameInstanceAs(cause); }