use of io.confluent.ksql.planner.JoinTree.Node in project ksql by confluentinc.
the class JoinTreeTest method shouldComputeEquivalenceSetWithoutOverlap.
@Test
public void shouldComputeEquivalenceSetWithoutOverlap() {
// Given:
when(j1.getLeftSource()).thenReturn(a);
when(j1.getRightSource()).thenReturn(b);
when(j2.getLeftSource()).thenReturn(a);
when(j2.getRightSource()).thenReturn(c);
when(j1.getLeftJoinExpression()).thenReturn(e1);
when(j1.getRightJoinExpression()).thenReturn(e2);
when(j2.getLeftJoinExpression()).thenReturn(e3);
when(j2.getRightJoinExpression()).thenReturn(e4);
final List<JoinInfo> joins = ImmutableList.of(j1, j2);
// When:
final Node root = JoinTree.build(joins);
// Then:
assertThat(root.joinEquivalenceSet(), containsInAnyOrder(e3, e4));
}