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_pathIsMissing_then_throws() {
        assertThatThrownBy(() -> resolvers.resolveAndValidateFields(emptyList(), singletonMap(OPTION_FORMAT, FORMAT)))
                .isInstanceOf(QueryException.class)
                .hasMessageContaining("Missing 'path");
    }