use of io.confluent.ksql.schema.ksql.SqlArgument in project ksql by confluentinc.
the class GenericsUtilTest method shouldIdentifySqlLambdaResolvedGenerics.
@Test
public void shouldIdentifySqlLambdaResolvedGenerics() {
// Given:
final GenericType typeA = GenericType.of("A");
final GenericType typeB = GenericType.of("B");
final LambdaType a = LambdaType.of(ImmutableList.of(typeA, typeB), typeB);
final SqlArgument instance = SqlArgument.of(SqlLambdaResolved.of(ImmutableList.of(SqlTypes.DOUBLE, SqlTypes.BIGINT), SqlTypes.BIGINT));
// When:
final Map<GenericType, SqlType> mapping = GenericsUtil.reserveGenerics(a, instance);
// Then:
assertThat(mapping, hasEntry(typeA, SqlTypes.DOUBLE));
assertThat(mapping, hasEntry(typeB, SqlTypes.BIGINT));
}
Aggregations