public static MetadataUpdate fromJson(String json) {
    return JsonUtil.parse(json, MetadataUpdateParser::fromJson);
  }
@Test
  public void testMetadataUpdateWithoutActionCannotDeserialize() {
    List<String> invalidJson =
        ImmutableList.of("{\"action\":null,\"format-version\":2}", "{\"format-version\":2}");

    for (String json : invalidJson) {
      assertThatThrownBy(() -> MetadataUpdateParser.fromJson(json))
          .isInstanceOf(IllegalArgumentException.class)
          .hasMessage("Cannot parse metadata update. Missing field: action");
    }
  }