use of org.mule.runtime.core.internal.metadata.DefaultFunctionDataType in project mule by mulesoft.
the class DataTypeBuilderTestCase method templateFunction.
@Test
public void templateFunction() {
FunctionParameter functionParameter = new FunctionParameter("fst", NUMBER);
final DataType template = DataType.builder().functionType(SomeFunction.class).returnType(STRING).parametersType(singletonList(functionParameter)).build();
final DataType dataType = DataType.builder(template).build();
assertThat(dataType, instanceOf(DefaultFunctionDataType.class));
assertThat(dataType.getType(), is(equalTo(SomeFunction.class)));
assertThat(((DefaultFunctionDataType) dataType).getReturnType().get(), is(STRING));
assertThat(((DefaultFunctionDataType) dataType).getParameters(), hasItems(functionParameter));
}
Aggregations