@Test void unknownKeysInMetadata() throws IOException { String json = jsonFactory.objectNode().put("name", "my-artifact").put("id", "123").toString(); Artifact deserializedArtifact = objectMapper.readValue(json, Artifact.class); assertThat(deserializedArtifact.getName()).isEqualTo("my-artifact"); assertThat(deserializedArtifact.getMetadata("id")).isEqualTo("123"); }
@Nullable public Object getMetadata(String key) { return metadata.get(key); }
Artifact { @Nullable public Object getMetadata(String key) { return metadata.get(key); } }
Artifact { @Nullable public Object getMetadata(String key) { return metadata.get(key); } @Builder(toBuilder = true) private  Artifact(
      String type,
      boolean customKind,
      String name,
      String version,
      String location,
      String reference,
      Map<String, Object> metadata,
      String artifactAccount,
      String provenance,
      String uuid); }
Artifact { @Nullable public Object getMetadata(String key) { return metadata.get(key); } @Builder(toBuilder = true) private  Artifact(
      String type,
      boolean customKind,
      String name,
      String version,
      String location,
      String reference,
      Map<String, Object> metadata,
      String artifactAccount,
      String provenance,
      String uuid); @Nullable Object getMetadata(String key); }
Artifact { @Nullable public Object getMetadata(String key) { return metadata.get(key); } @Builder(toBuilder = true) private  Artifact(
      String type,
      boolean customKind,
      String name,
      String version,
      String location,
      String reference,
      Map<String, Object> metadata,
      String artifactAccount,
      String provenance,
      String uuid); @Nullable Object getMetadata(String key);  }