io.github.bekoenig.assertj.schemacrawler.api.AbstractNamedObjectAssert Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of assertj-schemacrawler Show documentation
Show all versions of assertj-schemacrawler Show documentation
An assertj extension for schema-crawler.
package io.github.bekoenig.assertj.schemacrawler.api;
import org.assertj.core.api.AbstractComparableAssert;
import schemacrawler.schema.NamedObject;
import schemacrawler.schema.NamedObjectKey;
import java.util.function.Predicate;
public abstract class AbstractNamedObjectAssert<
SELF extends AbstractNamedObjectAssert, ACTUAL extends NamedObject>
extends AbstractComparableAssert {
protected AbstractNamedObjectAssert(ACTUAL actual, Class> selfType) {
super(actual, selfType);
}
public SELF matchesName(Predicate predicate) {
extracting(NamedObject::getName).matches(predicate);
return myself;
}
public SELF hasName(String name) {
return matchesName(Predicate.isEqual(name));
}
public SELF matchesFullName(Predicate predicate) {
extracting(NamedObject::getFullName).matches(predicate);
return myself;
}
public SELF hasFullName(String fullName) {
return matchesFullName(Predicate.isEqual(fullName));
}
public SELF matchesKey(Predicate predicate) {
extracting(NamedObject::key).matches(predicate);
return myself;
}
}