Package net.javacrumbs.jsonunit.core.internal

Examples of net.javacrumbs.jsonunit.core.internal.Diff.similar()


            this.expected = expected;
        }

        public boolean matches(Object item) {
            Diff diff = create(expected, item, "fullJson", path, configuration);
            if (!diff.similar()) {
                differences = diff.differences();
            }
            return diff.similar();
        }
View Full Code Here


        public boolean matches(Object item) {
            Diff diff = create(expected, item, "fullJson", path, configuration);
            if (!diff.similar()) {
                differences = diff.differences();
            }
            return diff.similar();
        }

        public void describeTo(Description description) {
            if ("".equals(path)) {
                description.appendText(safeToString());
View Full Code Here

     * @return {@code this} object.
     * @see #isStringEqualTo(String)
     */
    public JsonFluentAssert isEqualTo(Object expected) {
        Diff diff = createDiff(expected, configuration);
        if (!diff.similar()) {
            failWithMessage(diff.differences());
        }
        return this;
    }

View Full Code Here

     * @param expected
     * @return {@code this} object.
     */
    public JsonFluentAssert isNotEqualTo(Object expected) {
        Diff diff = createDiff(expected, configuration);
        if (diff.similar()) {
            failWithMessage("JSON is equal.");
        }
        return this;
    }

View Full Code Here

     * @param expected
     * @return {@code this} object.
     */
    public JsonFluentAssert hasSameStructureAs(Object expected) {
        Diff diff = createDiff(expected, configuration.withOptions(COMPARING_ONLY_STRUCTURE));
        if (!diff.similar()) {
            failWithMessage(diff.differences());
        }
        return this;
    }

View Full Code Here

     * @param path
     * @param configuration
     */
    public static void assertJsonPartEquals(Object expected, Object fullJson, String path, Configuration configuration) {
        Diff diff = create(expected, fullJson, FULL_JSON, path, configuration);
        if (!diff.similar()) {
            doFail(diff.toString());
        }
    }

    /**
 
View Full Code Here

     * @param fullJson
     * @param path
     */
    public static void assertJsonPartNotEquals(Object expected, Object fullJson, String path, Configuration configuration) {
        Diff diff = create(expected, fullJson, FULL_JSON, path, configuration);
        if (diff.similar()) {
            if (ROOT.equals(path)) {
                doFail("Expected different values but the values were equal.");
            } else {
                doFail(String.format("Expected different values in node \"%s\" but the values were equal.", path));
            }
View Full Code Here

     * @param expected
     * @param actual
     */
    public static void assertJsonStructureEquals(Object expected, Object actual) {
        Diff diff = create(expected, actual, ACTUAL, ROOT, configuration.withOptions(COMPARING_ONLY_STRUCTURE));
        if (!diff.similar()) {
            doFail(diff.differences());
        }
    }

    /**
 
View Full Code Here

     * @param fullJson
     * @param path
     */
    public static void assertJsonPartStructureEquals(Object expected, Object fullJson, String path) {
        Diff diff = create(expected, fullJson, FULL_JSON, path, configuration.withOptions(COMPARING_ONLY_STRUCTURE));
        if (!diff.similar()) {
            doFail(diff.differences());
        }
    }

    /**
 
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.