use of org.mule.metadata.api.builder.ArrayTypeBuilder in project mule by mulesoft.
the class IntrospectionUtilsTestCase method getDataTypeFromList.
@Test
public void getDataTypeFromList() {
Class<List> listClass = List.class;
Class<Integer> integerClass = Integer.class;
ArrayTypeBuilder arrayTypeBuilder = BaseTypeBuilder.create(JAVA).arrayType().with(new ClassInformationAnnotation(listClass));
arrayTypeBuilder.of().numberType().integer();
CollectionDataType dataType = (CollectionDataType) toDataType(arrayTypeBuilder.build());
assertThat(dataType.getType(), is(equalTo(listClass)));
assertThat(dataType.getItemDataType().getType(), is(equalTo(integerClass)));
}
Aggregations