@Test public void newKey() { String key = uriResolver.newKey(ROAD, VERSION); assertThat(key, is("prefix/roads/road/schemas/1/road_v1.avsc")); }
@VisibleForTesting String newKey(String road, int version) { List<String> elements = new ArrayList<>(); if (StringUtils.isNotBlank(keyPrefix)) { elements.add(keyPrefix); } elements.add("roads"); elements.add(road); elements.add("schemas"); elements.add(Integer.toString(version)); elements.add(road + "_v" + version + ".avsc"); String key = String.join("/", elements); return key; }
S3SchemaUriResolver implements SchemaUriResolver { @VisibleForTesting String newKey(String road, int version) { List<String> elements = new ArrayList<>(); if (StringUtils.isNotBlank(keyPrefix)) { elements.add(keyPrefix); } elements.add("roads"); elements.add(road); elements.add("schemas"); elements.add(Integer.toString(version)); elements.add(road + "_v" + version + ".avsc"); String key = String.join("/", elements); return key; } }
S3SchemaUriResolver implements SchemaUriResolver { @VisibleForTesting String newKey(String road, int version) { List<String> elements = new ArrayList<>(); if (StringUtils.isNotBlank(keyPrefix)) { elements.add(keyPrefix); } elements.add("roads"); elements.add(road); elements.add("schemas"); elements.add(Integer.toString(version)); elements.add(road + "_v" + version + ".avsc"); String key = String.join("/", elements); return key; } S3SchemaUriResolver(AmazonS3 s3Client, String bucket, String keyPrefix, boolean enableServerSideEncryption); @VisibleForTesting  S3SchemaUriResolver(
      TransferManager transferManager,
      String uriFormat,
      String bucket,
      String keyPrefix,
      boolean enableServerSideEncryption); }
S3SchemaUriResolver implements SchemaUriResolver { @VisibleForTesting String newKey(String road, int version) { List<String> elements = new ArrayList<>(); if (StringUtils.isNotBlank(keyPrefix)) { elements.add(keyPrefix); } elements.add("roads"); elements.add(road); elements.add("schemas"); elements.add(Integer.toString(version)); elements.add(road + "_v" + version + ".avsc"); String key = String.join("/", elements); return key; } S3SchemaUriResolver(AmazonS3 s3Client, String bucket, String keyPrefix, boolean enableServerSideEncryption); @VisibleForTesting  S3SchemaUriResolver(
      TransferManager transferManager,
      String uriFormat,
      String bucket,
      String keyPrefix,
      boolean enableServerSideEncryption); @Override URI resolve(Schema schema, String road, int version); }
S3SchemaUriResolver implements SchemaUriResolver { @VisibleForTesting String newKey(String road, int version) { List<String> elements = new ArrayList<>(); if (StringUtils.isNotBlank(keyPrefix)) { elements.add(keyPrefix); } elements.add("roads"); elements.add(road); elements.add("schemas"); elements.add(Integer.toString(version)); elements.add(road + "_v" + version + ".avsc"); String key = String.join("/", elements); return key; } S3SchemaUriResolver(AmazonS3 s3Client, String bucket, String keyPrefix, boolean enableServerSideEncryption); @VisibleForTesting  S3SchemaUriResolver(
      TransferManager transferManager,
      String uriFormat,
      String bucket,
      String keyPrefix,
      boolean enableServerSideEncryption); @Override URI resolve(Schema schema, String road, int version);  }