diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/java/org/apache/shardingsphere/sql/parser/integrate/asserts/SQLStatementAssert.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/java/org/apache/shardingsphere/sql/parser/integrate/asserts/SQLStatementAssert.java index c0a717b31f75fbc8586c1033e0fdaa13ff3430da..84d7dc332b97111df616f8e2b5acb4c1194fd59e 100644 --- a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/java/org/apache/shardingsphere/sql/parser/integrate/asserts/SQLStatementAssert.java +++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/java/org/apache/shardingsphere/sql/parser/integrate/asserts/SQLStatementAssert.java @@ -111,10 +111,8 @@ public final class SQLStatementAssert { } private void assertSelectStatement(final SelectStatement actual) { - Optional projectionsSegment = actual.findSQLSegment(ProjectionsSegment.class); - if (projectionsSegment.isPresent()) { - projectionAssert.assertProjections(projectionsSegment.get(), expected.getProjections()); - } + ProjectionsSegment actualProjections = actual.getProjections(); + projectionAssert.assertProjections(actualProjections, expected.getProjections()); Optional groupBySegment = actual.findSQLSegment(GroupBySegment.class); if (groupBySegment.isPresent()) { groupByAssert.assertGroupByItems(groupBySegment.get().getGroupByItems(), expected.getGroupByColumns());