package org.nzbhydra.mapping.newznab.json.caps;

import org.assertj.core.api.AbstractObjectAssert;
import org.assertj.core.util.Objects;

/**
 * Abstract base class for {@link CapsJsonLimits} specific assertions - Generated by CustomAssertionGenerator.
 */
@jakarta.annotation.Generated(value = "assertj-assertions-generator")
public abstract class AbstractCapsJsonLimitsAssert<S extends AbstractCapsJsonLimitsAssert<S, A>, A extends CapsJsonLimits> extends AbstractObjectAssert<S, A> {

    /**
     * Creates a new <code>{@link AbstractCapsJsonLimitsAssert}</code> to make assertions on actual CapsJsonLimits.
     *
     * @param actual the CapsJsonLimits we want to make assertions on.
     */
    protected AbstractCapsJsonLimitsAssert(A actual, Class<S> selfType) {
        super(actual, selfType);
    }

    /**
     * Verifies that the actual CapsJsonLimits's attributes is equal to the given one.
     *
     * @param attributes the given attributes to compare the actual CapsJsonLimits's attributes to.
     * @return this assertion object.
     * @throws AssertionError - if the actual CapsJsonLimits's attributes is not equal to the given one.
     */
    public S hasAttributes(CapsJsonLimitsAttributes attributes) {
        // check that actual CapsJsonLimits we want to make assertions on is not null.
        isNotNull();

        // overrides the default error message with a more explicit one
        String assertjErrorMessage = "\nExpecting attributes of:\n  <%s>\nto be:\n  <%s>\nbut was:\n  <%s>";

        // null safe check
        CapsJsonLimitsAttributes actualAttributes = actual.getAttributes();
        if (!Objects.areEqual(actualAttributes, attributes)) {
            failWithMessage(assertjErrorMessage, actual, attributes, actualAttributes);
        }

        // return the current assertion for method chaining
        return myself;
    }

}
