io.github.bekoenig.assertj.schemacrawler.api.AbstractViewAssert 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.FactoryBasedNavigableIterableAssert;
import schemacrawler.schema.CheckOptionType;
import schemacrawler.schema.Table;
import schemacrawler.schema.View;
import java.util.Collection;
import java.util.function.Consumer;
public abstract class AbstractViewAssert>
extends AbstractTableAssert {
protected AbstractViewAssert(View actual, Class> selfType) {
super(actual, selfType);
}
public SELF satisfiesCheckOption(Consumer requirement) {
extracting(View::getCheckOption).satisfies(requirement);
return myself;
}
public FactoryBasedNavigableIterableAssert, Collection, Table, TableAssert> tableUsage() {
isNotNull();
return new FactoryBasedNavigableIterableAssert<>(
actual.getTableUsage(),
FactoryBasedNavigableIterableAssert.class, SchemaCrawlerAssertions::assertThat);
}
public SELF isUpdatable(boolean expected) {
return returns(expected, View::isUpdatable);
}
public TableAssert table(String schemaName, String tableName) {
return extracting(x -> x.lookupTable(x.getSchema(), tableName).orElse(null))
.asInstanceOf(SchemaCrawlerInstanceOfAssertFactories.table());
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy