From e4e9d1e9a811c40050856c3f7940a4d5d611984e Mon Sep 17 00:00:00 2001 From: Lukas Krecan Date: Sun, 6 Feb 2022 07:47:53 +0100 Subject: [PATCH] Switch JsonObjectAssert to AbstractAssert --- .../jsonunit/assertj/JsonObjectAssert.java | 94 +------------------ 1 file changed, 2 insertions(+), 92 deletions(-) diff --git a/json-unit-assertj/src/main/java/net/javacrumbs/jsonunit/assertj/JsonObjectAssert.java b/json-unit-assertj/src/main/java/net/javacrumbs/jsonunit/assertj/JsonObjectAssert.java index aa5e22e71..678cdc152 100644 --- a/json-unit-assertj/src/main/java/net/javacrumbs/jsonunit/assertj/JsonObjectAssert.java +++ b/json-unit-assertj/src/main/java/net/javacrumbs/jsonunit/assertj/JsonObjectAssert.java @@ -18,11 +18,11 @@ import net.javacrumbs.jsonunit.core.Configuration; import net.javacrumbs.jsonunit.core.internal.Diff; import net.javacrumbs.jsonunit.core.internal.Path; -import org.assertj.core.api.AbstractObjectAssert; +import org.assertj.core.api.AbstractAssert; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -public class JsonObjectAssert extends AbstractObjectAssert { +public class JsonObjectAssert extends AbstractAssert { private final Configuration configuration; private final Path path; @@ -39,96 +39,6 @@ public JsonObjectAssert isEqualTo(@Nullable Object expected) { return compare(expected, configuration); } - @Override - @NotNull - @Deprecated - public JsonObjectAssert isEqualToIgnoringGivenFields(@Nullable Object other, @NotNull String... propertiesOrFieldsToIgnore) { - return compare(other, configuration.whenIgnoringPaths(propertiesOrFieldsToIgnore)); - } - - @Override - @NotNull - @Deprecated - public JsonObjectAssert isEqualToComparingOnlyGivenFields(@Nullable Object other, @NotNull String... propertiesOrFieldsUsedInComparison) { - throw unsupportedOperation(); - } - - @Override - @NotNull - @Deprecated - public JsonObjectAssert isEqualToIgnoringNullFields(@Nullable Object other) { - throw unsupportedOperation(); - } - - @Override - @NotNull - @Deprecated - public JsonObjectAssert isEqualToComparingFieldByField(@Nullable Object other) { - throw unsupportedOperation(); - } - - @Override - @NotNull - @Deprecated - public JsonObjectAssert isEqualToComparingFieldByFieldRecursively(@Nullable Object other) { - throw unsupportedOperation(); - } - /** - * Does not work. - * https://github.com/lukas-krecan/JsonUnit/issues/324 - */ - @Override - @Deprecated - public JsonObjectAssert hasFieldOrProperty(String name) { - return super.hasFieldOrProperty(name); - } - - /** - * Does not work. - * https://github.com/lukas-krecan/JsonUnit/issues/324 - */ - @Override - @Deprecated - public JsonObjectAssert hasFieldOrPropertyWithValue(String name, Object value) { - return super.hasFieldOrPropertyWithValue(name, value); - } - - /** - * Does not work. https://github.com/lukas-krecan/JsonUnit/issues/324 - */ - @Override - @Deprecated - public JsonObjectAssert hasAllNullFieldsOrProperties() { - return super.hasAllNullFieldsOrProperties(); - } - - /** - * Does not work. https://github.com/lukas-krecan/JsonUnit/issues/324 - */ - @Override - @Deprecated - public JsonObjectAssert hasAllNullFieldsOrPropertiesExcept(String... propertiesOrFieldsToIgnore) { - return super.hasAllNullFieldsOrPropertiesExcept(propertiesOrFieldsToIgnore); - } - - /** - * Does not work. https://github.com/lukas-krecan/JsonUnit/issues/324 - */ - @Deprecated - @Override - public JsonObjectAssert hasNoNullFieldsOrProperties() { - return super.hasNoNullFieldsOrProperties(); - } - - /** - * Does not work. https://github.com/lukas-krecan/JsonUnit/issues/324 - */ - @Override - @Deprecated - public JsonObjectAssert hasNoNullFieldsOrPropertiesExcept(String... propertiesOrFieldsToIgnore) { - return super.hasNoNullFieldsOrPropertiesExcept(propertiesOrFieldsToIgnore); - } - @NotNull private UnsupportedOperationException unsupportedOperation() { return new UnsupportedOperationException("Operation not supported for JSON documents");