public TableMetadata readTableMetadata(String metadataLocation) {
    URI metadataLocationUri = URI.create(metadataLocation);
    // TODO: cache fileIO
    FileIO fileIO = fileIOFactory.getFileIO(metadataLocationUri);

    return CompletableFuture.supplyAsync(() -> TableMetadataParser.read(fileIO, metadataLocation))
        .join();
  }
@SneakyThrows
  @Test
  public void testGetTableMetadataFromS3() {
    when(mockFileIOFactory.getFileIO(any())).thenReturn(new S3FileIO(() -> mockS3Client));
    mockS3Client.createBucket(builder -> builder.bucket(TEST_BUCKET).build());
    String simpleMetadataJson =
        IOUtils.toString(
            Objects.requireNonNull(
                this.getClass()
                    .getResourceAsStream("/" + TEST_SIMPLE_ICEBERG_V1_METADATA_FILE_NAME)));
    mockS3Client.putObject(
        builder ->
            builder
                .bucket(TEST_BUCKET)
                .key(TEST_LOCATION + "/" + TEST_SIMPLE_ICEBERG_V1_METADATA_FILE_NAME)
                .build(),
        RequestBody.fromString(simpleMetadataJson));

    String metadataLocation =
        "s3://"
            + TEST_BUCKET
            + "/"
            + TEST_LOCATION
            + "/"
            + TEST_SIMPLE_ICEBERG_V1_METADATA_FILE_NAME;
    TableMetadata tableMetadata = metadataService.readTableMetadata(metadataLocation);
    assertThat(tableMetadata.uuid()).isEqualTo("11111111-2222-3333-4444-555555555555");
  }