terrymanu commented on a change in pull request #3281: #3138 improved coverage
for sharding core preprocessor
URL:
https://github.com/apache/incubator-shardingsphere/pull/3281#discussion_r335032080
##########
File path:
sharding-core/sharding-core-preprocessor/src/test/java/org/apache/shardingsphere/core/preprocessor/segment/select/projection/engine/ProjectionsContextEngineTest.java
##########
@@ -59,4 +62,40 @@ public void
assertProjectionsContextCreatedProperlyWhenSelectItemPresent() {
ProjectionsContext projectionsContext = new
ProjectionsContextEngine(null).createProjectionsContext(null, selectStatement,
mock(GroupByContext.class), mock(OrderByContext.class));
assertNotNull(projectionsContext);
}
+
+ @Test
+ public void
assertProjectionsContextCreatedProperlyWhenOrderByContextOrderItemsPresent() {
+ SelectStatement selectStatement = mock(SelectStatement.class);
+ SelectItemsSegment selectItemsSegment = mock(SelectItemsSegment.class);
+ when(selectStatement.getSelectItems()).thenReturn(selectItemsSegment);
+ ShorthandSelectItemSegment shorthandSelectItemSegment = new
ShorthandSelectItemSegment(0, 10, "text");
+ TableSegment owner = new TableSegment(0, 10, "name");
+ owner.setOwner(new SchemaSegment(0, 10, "name"));
+ shorthandSelectItemSegment.setOwner(owner);
+
when(selectItemsSegment.getSelectItems()).thenReturn(Collections.<SelectItemSegment>singleton(shorthandSelectItemSegment));
+ OrderByContext orderByContext = mock(OrderByContext.class);
+ OrderByItem orderByItem = mock(OrderByItem.class);
+
when(orderByItem.getSegment()).thenReturn(mock(IndexOrderByItemSegment.class));
Review comment:
More blank line is unnecessary.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services