Search in sources :

Example 1 with ExpectedTable

use of io.shardingjdbc.core.parsing.integrate.jaxb.table.ExpectedTable in project sharding-jdbc by shardingjdbc.

the class TableAssert method assertTables.

/**
 * Assert tables.
 *
 * @param actual actual tables
 * @param expected expected tables
 */
public void assertTables(final Tables actual, final List<ExpectedTable> expected) {
    assertThat(assertMessage.getFullAssertMessage("Tables size assertion error: "), actual.getTableNames().size(), is(expected.size()));
    for (ExpectedTable each : expected) {
        Optional<Table> table;
        if (null != each.getAlias()) {
            table = actual.find(each.getAlias());
        } else {
            table = actual.find(each.getName());
        }
        assertTrue(assertMessage.getFullAssertMessage("Table should exist: "), table.isPresent());
        assertTable(table.get(), each);
    }
}
Also used : ExpectedTable(io.shardingjdbc.core.parsing.integrate.jaxb.table.ExpectedTable) ExpectedTable(io.shardingjdbc.core.parsing.integrate.jaxb.table.ExpectedTable) Table(io.shardingjdbc.core.parsing.parser.context.table.Table)

Aggregations

ExpectedTable (io.shardingjdbc.core.parsing.integrate.jaxb.table.ExpectedTable)1 Table (io.shardingjdbc.core.parsing.parser.context.table.Table)1