You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by du...@apache.org on 2022/06/14 04:32:03 UTC

[shardingsphere] branch master updated: Revise #18223 (#18349)

This is an automated email from the ASF dual-hosted git repository.

duanzhengqiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git


The following commit(s) were added to refs/heads/master by this push:
     new 6b9927c1af5 Revise #18223 (#18349)
6b9927c1af5 is described below

commit 6b9927c1af5c871c6d8058f58c2484c2efee750c
Author: Liang Zhang <zh...@apache.org>
AuthorDate: Tue Jun 14 12:31:57 2022 +0800

    Revise #18223 (#18349)
---
 .../select/projection/engine/ProjectionEngineTest.java | 18 +++++++-----------
 1 file changed, 7 insertions(+), 11 deletions(-)

diff --git a/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/segment/select/projection/engine/ProjectionEngineTest.java b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/segment/select/projection/engine/ProjectionEngineTest.java
index e65b3f92ce5..a2070692a54 100644
--- a/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/segment/select/projection/engine/ProjectionEngineTest.java
+++ b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/segment/select/projection/engine/ProjectionEngineTest.java
@@ -174,23 +174,19 @@ public final class ProjectionEngineTest {
         when(schema.getAllColumnNames("t_order")).thenReturn(Arrays.asList("order_id", "customer_id"));
         SimpleTableSegment customersTableSegment = new SimpleTableSegment(new TableNameSegment(0, 0, new IdentifierValue("t_customer")));
         when(schema.getAllColumnNames("t_customer")).thenReturn(Collections.singletonList("customer_id"));
-        
         JoinTableSegment table = new JoinTableSegment();
         table.setLeft(ordersTableSegment);
         table.setRight(customersTableSegment);
         table.setCondition(new CommonExpressionSegment(0, 0, "t_order.customer_id=t_customer.customer_id"));
-        
         ShorthandProjectionSegment shorthandProjectionSegment = new ShorthandProjectionSegment(0, 10);
-        Optional<Projection> actual = new ProjectionEngine(DefaultDatabase.LOGIC_NAME, Collections.singletonMap(DefaultDatabase.LOGIC_NAME, schema), databaseType)
-                .createProjection(table, shorthandProjectionSegment);
-        
+        Optional<Projection> actual = new ProjectionEngine(
+                DefaultDatabase.LOGIC_NAME, Collections.singletonMap(DefaultDatabase.LOGIC_NAME, schema), databaseType).createProjection(table, shorthandProjectionSegment);
         assertTrue(actual.isPresent());
         assertThat(actual.get(), instanceOf(ShorthandProjection.class));
-        assertThat(((ShorthandProjection) actual.get()).getActualColumns().size(), is(3));
-        Map<String, ColumnProjection> actualColumns = new LinkedHashMap<>();
-        actualColumns.put("t_order.order_id", new ColumnProjection("t_order", "order_id", null));
-        actualColumns.put("t_order.customer_id", new ColumnProjection("t_order", "customer_id", null));
-        actualColumns.put("t_customer.customer_id", new ColumnProjection("t_customer", "customer_id", null));
-        assertThat(((ShorthandProjection) actual.get()).getActualColumns(), is(actualColumns));
+        Map<String, ColumnProjection> actualColumns = ((ShorthandProjection) actual.get()).getActualColumns();
+        assertThat(actualColumns.size(), is(3));
+        assertThat(actualColumns.get("t_order.order_id"), is(new ColumnProjection("t_order", "order_id", null)));
+        assertThat(actualColumns.get("t_order.customer_id"), is(new ColumnProjection("t_order", "customer_id", null)));
+        assertThat(actualColumns.get("t_customer.customer_id"), is(new ColumnProjection("t_customer", "customer_id", null)));
     }
 }