@Override
  public void initialize(Map<String, String> props) {
    this.properties = SerializableMap.copyOf(props);
    this.gcpProperties = new GCPProperties(properties);

    this.storageSupplier =
        () -> {
          StorageOptions.Builder builder = StorageOptions.newBuilder();

          gcpProperties.projectId().ifPresent(builder::setProjectId);
          gcpProperties.clientLibToken().ifPresent(builder::setClientLibToken);
          gcpProperties.serviceHost().ifPresent(builder::setHost);

          // Google Cloud APIs default to automatically detect the credentials to use, which is
          // in most cases the convenient way, especially in GCP.
          // See javadoc of com.google.auth.oauth2.GoogleCredentials.getApplicationDefault().
          if (gcpProperties.noAuth()) {
            // Explicitly allow "no credentials" for testing purposes.
            builder.setCredentials(NoCredentials.getInstance());
          }
          gcpProperties
              .oauth2Token()
              .ifPresent(
                  token -> {
                    // Explicitly configure an OAuth token.
                    AccessToken accessToken =
                        new AccessToken(token, gcpProperties.oauth2TokenExpiresAt().orElse(null));
                    builder.setCredentials(OAuth2Credentials.create(accessToken));
                  });

          return builder.build().getService();
        };

    initMetrics(properties);
  }
@Test
  public void testResolvingFileIOLoad() {
    ResolvingFileIO resolvingFileIO = new ResolvingFileIO();
    resolvingFileIO.setConf(new Configuration());
    resolvingFileIO.initialize(ImmutableMap.of());
    FileIO result =
        DynMethods.builder("io")
            .hiddenImpl(ResolvingFileIO.class, String.class)
            .build(resolvingFileIO)
            .invoke("gs://foo/bar");
    assertThat(result).isInstanceOf(GCSFileIO.class);
  }