From 577c2c46d35d0a8cb518edcd8c04ac111b7189c4 Mon Sep 17 00:00:00 2001 From: terrymanu Date: Fri, 17 Jan 2020 17:44:10 +0800 Subject: [PATCH] refactor assertSelectStatement's assertProjections --- .../sql/parser/integrate/asserts/SQLStatementAssert.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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 c0a717b31f..84d7dc332b 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()); -- GitLab