@Test
public void shouldOptimizePlanForSimpleQueryWithSelectStarFromViewWithAliasAndValueCriteria() {

    node = optimize("SELECT * FROM v1 AS x1 WHERE c11 = 'value'");
    // Create the expected plan ...
    PlanNode expected = new PlanNode(Type.ACCESS, selector("x1"));
    PlanNode project = new PlanNode(Type.PROJECT, expected, selector("x1"));
    project.setProperty(Property.PROJECT_COLUMNS, columns(column("x1", "c11"), column("x1", "c12", "c2")));
    PlanNode select1 = new PlanNode(Type.SELECT, project, selector("x1"));
    select1.setProperty(Property.SELECT_CRITERIA, new Comparison(new PropertyValue(selector("x1"), "c11"), Operator.EQUAL_TO,
                                                                 new Literal("value")));
    PlanNode select2 = new PlanNode(Type.SELECT, select1, selector("x1"));
    select2.setProperty(Property.SELECT_CRITERIA, new Comparison(new PropertyValue(selector("x1"), "c13"),
                                                                 Operator.LESS_THAN, new Literal(3L)));
    PlanNode source = new PlanNode(Type.SOURCE, select2, selector("x1"));
    source.setProperty(Property.SOURCE_NAME, selector("t1"));
    source.setProperty(Property.SOURCE_ALIAS, selector("x1"));
    source.setProperty(Property.SOURCE_COLUMNS, context.getSchemata().getTable(selector("t1")).getColumns());
    // Compare the expected and actual plan ...
    assertPlanMatches(expected);
}