@ParameterizedTest @ArgumentsSource(TestCaseArgumentsProvider.class) @TestCase({"UNION", "union"}) @TestCase({"UNION_ALL", "union all"}) void addUnion(UnionType unionType, String unionSql) { SelectStatement<Integer> sut = new SelectStatement<>(createScope(), TypeToken.of(Integer.class), from, rowMapper, projection); when(projection.sql(any())).thenReturn("*"); when(from.sql(any())).thenReturn(" from foo"); when(union.sqlImpl(any())).thenReturn("select * from bar"); sut.addUnion(union, unionType); String sql = sut.sql(); assertThat(sql, is("select * from foo " + unionSql + " select * from bar")); }
void addUnion(SelectStatement<RT> next, UnionType unionType) { unions.add(Tuple.of(unionType, next)); }
SelectStatement { void addUnion(SelectStatement<RT> next, UnionType unionType) { unions.add(Tuple.of(unionType, next)); } }
SelectStatement { void addUnion(SelectStatement<RT> next, UnionType unionType) { unions.add(Tuple.of(unionType, next)); } SelectStatement(Scope scope, TypeToken<RT> rowType, From from, RowMapper<RT> rowMapper, Projection projection); }
SelectStatement { void addUnion(SelectStatement<RT> next, UnionType unionType) { unions.add(Tuple.of(unionType, next)); } SelectStatement(Scope scope, TypeToken<RT> rowType, From from, RowMapper<RT> rowMapper, Projection projection); TypeToken<RT> rowType(); Stream<CommonTableExpression<?>> commonTableExpressions(); }
SelectStatement { void addUnion(SelectStatement<RT> next, UnionType unionType) { unions.add(Tuple.of(unionType, next)); } SelectStatement(Scope scope, TypeToken<RT> rowType, From from, RowMapper<RT> rowMapper, Projection projection); TypeToken<RT> rowType(); Stream<CommonTableExpression<?>> commonTableExpressions();  }