// Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/Option.java
// public enum Option {
//     /**
//      * Treats null nodes in actual value as absent. In other words
//      * if you expect {"test":{"a":1}} this {"test":{"a":1, "b": null}} will pass the test.
//      * When using within {@link ConfigurationWhen#then(Option, Option...)}, exact path to such nodes should be passed,
//      * which is test.b in the example above.
//      */
//     TREATING_NULL_AS_ABSENT,
// 
//     /**
//      * When comparing arrays, ignores array order. In other words, treats arrays as sets.
//      */
//     IGNORING_ARRAY_ORDER,
// 
//     /**
//      * Ignores extra fields in the actual value.
//      * When using within {@link ConfigurationWhen#then(Option, Option...)}, path to the nodes with such fields should be passed.
//      */
//     IGNORING_EXTRA_FIELDS,
// 
// 
//     /**
//      * Passes even if array in compared document has more items than expected.
//      * Items are taken from the beginning of the expected array unless IGNORING_ARRAY_ORDER is specified.
//      */
//     IGNORING_EXTRA_ARRAY_ITEMS,
// 
//     /**
//      * Compares only structures. Completely ignores both values and types.
//      * Is too lenient, ignores types, prefer {@link Option#IGNORING_VALUES} instead.
//      *
//      * @deprecated Use IGNORING_VALUES option instead
//      */
//     @Deprecated
//     COMPARING_ONLY_STRUCTURE,
// 
//     /**
//      * Ignores values but fails if value types are different.
//      * When using within {@link ConfigurationWhen#then(Option, Option...)}, path to the node with ignored value should be passed.
//      */
//     IGNORING_VALUES
// }
// 
// Path: json-unit-fluent/src/main/java/net/javacrumbs/jsonunit/fluent/JsonFluentAssert.java
// public static ConfigurableJsonFluentAssert assertThatJson(Object json) {
//     return new ConfigurableJsonFluentAssert(convertToJson(json, ACTUAL), getPathPrefix(json));
// }
// 
// Path: json-unit-json-path/src/main/java/net/javacrumbs/jsonunit/jsonpath/JsonPathAdapter.java
// public static Object inPath(@NotNull Object json, @NotNull String path) {
//     String normalizedPath = fromBracketNotation(path);
//     try {
//         MatchRecordingListener recordingListener = new MatchRecordingListener();
//         Object value = readValue(defaultConfiguration().addEvaluationListeners(recordingListener), json, path);
//         return jsonSource(wrapDeserializedObject(value), normalizedPath, recordingListener.getMatchingPaths());
//     } catch (PathNotFoundException e) {
//         return jsonSource(missingNode(), normalizedPath);
//     }
// }


import net.javacrumbs.jsonunit.core.Option;
import org.junit.jupiter.api.Test;
import static net.javacrumbs.jsonunit.fluent.JsonFluentAssert.assertThatJson;
import static net.javacrumbs.jsonunit.jsonpath.JsonPathAdapter.inPath;
import static org.assertj.core.api.Assertions.assertThatThrownBy;

    }

    @Test
    void shouldBeAbleToUseSimpleValuesAndIgnoreArrayOrder() {
        assertThatJson(inPath(json, "$.store.book[*].author"))
            .when(Option.IGNORING_ARRAY_ORDER)
            .isEqualTo("['J. R. R. Tolkien', 'Nigel Rees', 'Evelyn Waugh', 'Herman Melville']");

    }

    @Test
    void shouldBeAbleToUseSimpleValuesFailure() {
        assertThatThrownBy(() -> assertThatJson(inPath(json, "$.store.book[*].author"))
            .isEqualTo("['Nigel Rees', 'Evelyn Waugh', 'Herman Melville', 'Arthur C. Clark']"))
            .hasMessage("JSON documents are different:\n" +
                "Different value found in node \"$.store.book[*].author[3]\", expected: <\"Arthur C. Clark\"> but was: <\"J. R. R. Tolkien\">.\n");
    }

    @Test
    void shouldBeAbleToUseObjects() {
        assertThatThrownBy(() -> assertThatJson(inPath(json, "$.store.book[0]"))
            .isEqualTo(
                "            {\n" +
                    "                \"category\": \"reference\",\n" +
                    "                \"author\": \"Nigel Rees\",\n" +
                    "                \"title\": \"Sayings of the Century\",\n" +
                    "                \"price\": 8.96\n" +
                    "            }"))
            .hasMessage("JSON documents are different:\n" +
// Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/Option.java
// public enum Option {
//     /**
//      * Treats null nodes in actual value as absent. In other words
//      * if you expect {"test":{"a":1}} this {"test":{"a":1, "b": null}} will pass the test.
//      * When using within {@link ConfigurationWhen#then(Option, Option...)}, exact path to such nodes should be passed,
//      * which is test.b in the example above.
//      */
//     TREATING_NULL_AS_ABSENT,
// 
//     /**
//      * When comparing arrays, ignores array order. In other words, treats arrays as sets.
//      */
//     IGNORING_ARRAY_ORDER,
// 
//     /**
//      * Ignores extra fields in the actual value.
//      * When using within {@link ConfigurationWhen#then(Option, Option...)}, path to the nodes with such fields should be passed.
//      */
//     IGNORING_EXTRA_FIELDS,
// 
// 
//     /**
//      * Passes even if array in compared document has more items than expected.
//      * Items are taken from the beginning of the expected array unless IGNORING_ARRAY_ORDER is specified.
//      */
//     IGNORING_EXTRA_ARRAY_ITEMS,
// 
//     /**
//      * Compares only structures. Completely ignores both values and types.
//      * Is too lenient, ignores types, prefer {@link Option#IGNORING_VALUES} instead.
//      *
//      * @deprecated Use IGNORING_VALUES option instead
//      */
//     @Deprecated
//     COMPARING_ONLY_STRUCTURE,
// 
//     /**
//      * Ignores values but fails if value types are different.
//      * When using within {@link ConfigurationWhen#then(Option, Option...)}, path to the node with ignored value should be passed.
//      */
//     IGNORING_VALUES
// }
// 
// Path: json-unit-fluent/src/main/java/net/javacrumbs/jsonunit/fluent/JsonFluentAssert.java
// public static ConfigurableJsonFluentAssert assertThatJson(Object json) {
//     return new ConfigurableJsonFluentAssert(convertToJson(json, ACTUAL), getPathPrefix(json));
// }
// 
// Path: json-unit-json-path/src/main/java/net/javacrumbs/jsonunit/jsonpath/JsonPathAdapter.java
// public static Object inPath(@NotNull Object json, @NotNull String path) {
//     String normalizedPath = fromBracketNotation(path);
//     try {
//         MatchRecordingListener recordingListener = new MatchRecordingListener();
//         Object value = readValue(defaultConfiguration().addEvaluationListeners(recordingListener), json, path);
//         return jsonSource(wrapDeserializedObject(value), normalizedPath, recordingListener.getMatchingPaths());
//     } catch (PathNotFoundException e) {
//         return jsonSource(missingNode(), normalizedPath);
//     }
// }


// Path: tests/test-json-path/src/test/java/net/javacrumbs/jsonunit/test/jsonpath/JsonPathTest.java
import net.javacrumbs.jsonunit.core.Option;
import org.junit.jupiter.api.Test;
import static net.javacrumbs.jsonunit.fluent.JsonFluentAssert.assertThatJson;
import static net.javacrumbs.jsonunit.jsonpath.JsonPathAdapter.inPath;
import static org.assertj.core.api.Assertions.assertThatThrownBy;


    }

    @Test
    void shouldBeAbleToUseSimpleValuesAndIgnoreArrayOrder() {
        assertThatJson(inPath(json, "$.store.book[*].author"))
            .when(Option.IGNORING_ARRAY_ORDER)
            .isEqualTo("['J. R. R. Tolkien', 'Nigel Rees', 'Evelyn Waugh', 'Herman Melville']");

    }

    @Test
    void shouldBeAbleToUseSimpleValuesFailure() {
        assertThatThrownBy(() -> assertThatJson(inPath(json, "$.store.book[*].author"))
            .isEqualTo("['Nigel Rees', 'Evelyn Waugh', 'Herman Melville', 'Arthur C. Clark']"))
            .hasMessage("JSON documents are different:\n" +
                "Different value found in node \"$.store.book[*].author[3]\", expected: <\"Arthur C. Clark\"> but was: <\"J. R. R. Tolkien\">.\n");
    }

    @Test
    void shouldBeAbleToUseObjects() {
        assertThatThrownBy(() -> assertThatJson(inPath(json, "$.store.book[0]"))
            .isEqualTo(
                "            {\n" +
                    "                \"category\": \"reference\",\n" +
                    "                \"author\": \"Nigel Rees\",\n" +
                    "                \"title\": \"Sayings of the Century\",\n" +
                    "                \"price\": 8.96\n" +
                    "            }"))
            .hasMessage("JSON documents are different:\n" +
                "Different value found in node \"$.store.book[0].price\", expected: <8.96> but was: <8.95>.\n");