All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.github.bekoenig.assertj.schemacrawler.api.AbstractDependantObjectAssert Maven / Gradle / Ivy

package io.github.bekoenig.assertj.schemacrawler.api;

import org.assertj.core.api.AbstractObjectAssert;
import schemacrawler.schema.DatabaseObject;
import schemacrawler.schema.DependantObject;

import java.util.function.Predicate;

public abstract class AbstractDependantObjectAssert<
        SELF extends AbstractDependantObjectAssert,
        ACTUAL extends DependantObject,
        PARENT extends DatabaseObject>
        extends AbstractDatabaseObjectAssert {

    protected AbstractDependantObjectAssert(ACTUAL actual, Class selfType) {
        super(actual, selfType);
    }

    public SELF matchesShortName(Predicate predicate) {
        extracting(DependantObject::getShortName).matches(predicate);
        return myself;
    }

    public SELF isParentPartial(boolean expected) {
        returns(expected, DependantObject::isParentPartial);
        return myself;
    }

    public AbstractObjectAssert parent() {
        return extracting(DependantObject::getParent);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy