List<MappingField> resolveAndValidateFields(List<MappingField> userFields, Map<String, ?> options) {
        if (options.get(OPTION_FORMAT) == null) {
            throw QueryException.error("Missing '" + OPTION_FORMAT + "' option");
        }
        if (options.get(OPTION_PATH) == null) {
            throw QueryException.error("Missing '" + OPTION_PATH + "' option");
        }

        List<MappingField> fields = findMetadataResolver(options).resolveAndValidateFields(userFields, options);
        if (fields.isEmpty()) {
            throw QueryException.error("The resolved field list is empty");
        }
        return fields;
    }
@Test
    public void when_formatIsNotSupported_then_throws() {
        assertThatThrownBy(() -> resolvers.resolveAndValidateFields(
                emptyList(),
                Map.of(OPTION_FORMAT, "some-other-format", OPTION_PATH, "/path")
        )).isInstanceOf(QueryException.class)
          .hasMessageContaining("Unsupported serialization format");
    }