提交 577c2c46 编写于 作者: T terrymanu

refactor assertSelectStatement's assertProjections

上级 e29883b3
...@@ -111,10 +111,8 @@ public final class SQLStatementAssert { ...@@ -111,10 +111,8 @@ public final class SQLStatementAssert {
} }
private void assertSelectStatement(final SelectStatement actual) { private void assertSelectStatement(final SelectStatement actual) {
Optional<ProjectionsSegment> projectionsSegment = actual.findSQLSegment(ProjectionsSegment.class); ProjectionsSegment actualProjections = actual.getProjections();
if (projectionsSegment.isPresent()) { projectionAssert.assertProjections(actualProjections, expected.getProjections());
projectionAssert.assertProjections(projectionsSegment.get(), expected.getProjections());
}
Optional<GroupBySegment> groupBySegment = actual.findSQLSegment(GroupBySegment.class); Optional<GroupBySegment> groupBySegment = actual.findSQLSegment(GroupBySegment.class);
if (groupBySegment.isPresent()) { if (groupBySegment.isPresent()) {
groupByAssert.assertGroupByItems(groupBySegment.get().getGroupByItems(), expected.getGroupByColumns()); groupByAssert.assertGroupByItems(groupBySegment.get().getGroupByItems(), expected.getGroupByColumns());
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册