Search in sources :

Example 1 with ExpectedCondition

use of io.shardingjdbc.core.parsing.integrate.jaxb.condition.ExpectedCondition in project sharding-jdbc by shardingjdbc.

the class ConditionAssert method assertConditions.

/**
 * Assert conditions.
 *
 * @param actual actual conditions
 * @param expected expected conditions
 */
public void assertConditions(final Conditions actual, final List<ExpectedCondition> expected) {
    assertThat(assertMessage.getFullAssertMessage("Conditions size assertion error: "), actual.getConditions().size(), is(expected.size()));
    for (ExpectedCondition each : expected) {
        Optional<Condition> condition = actual.find(new Column(each.getColumnName(), each.getTableName()));
        assertTrue(assertMessage.getFullAssertMessage("Table should exist: "), condition.isPresent());
        assertCondition(condition.get(), each);
    }
}
Also used : ExpectedCondition(io.shardingjdbc.core.parsing.integrate.jaxb.condition.ExpectedCondition) Condition(io.shardingjdbc.core.parsing.parser.context.condition.Condition) Column(io.shardingjdbc.core.parsing.parser.context.condition.Column) ExpectedCondition(io.shardingjdbc.core.parsing.integrate.jaxb.condition.ExpectedCondition)

Aggregations

ExpectedCondition (io.shardingjdbc.core.parsing.integrate.jaxb.condition.ExpectedCondition)1 Column (io.shardingjdbc.core.parsing.parser.context.condition.Column)1 Condition (io.shardingjdbc.core.parsing.parser.context.condition.Condition)1