use of org.mule.runtime.module.extension.internal.loader.java.type.runtime.TypeWrapper in project mule by mulesoft.
the class IntrospectionUtilsTestCase method getPagingProviderImplementationTypes.
@Test
public void getPagingProviderImplementationTypes() {
ResolvableType pagingProvider = ResolvableType.forClass(TestPagingProvider.class);
Pair<Type, Type> pagingProviderTypes = getPagingProviderTypes(new TypeWrapper(pagingProvider, TYPE_LOADER));
assertThat(pagingProviderTypes.getFirst().getDeclaringClass().get(), equalTo(Object.class));
assertThat(pagingProviderTypes.getSecond().getDeclaringClass().get(), equalTo(Result.class));
}
use of org.mule.runtime.module.extension.internal.loader.java.type.runtime.TypeWrapper in project mule by mulesoft.
the class GroupValueSetterTestCase method before.
@Before
public void before() throws Exception {
final String personalInfo = "personalInfo";
ParameterGroupDescriptor group = new ParameterGroupDescriptor("group", new TypeWrapper(PersonalInfo.class, new JavaTypeLoader(Thread.currentThread().getContextClassLoader())), ExtensionsTypeLoaderFactory.getDefault().createTypeLoader().load(PersonalInfo.class), getField(HeisenbergExtension.class, personalInfo, reflectionCache).get(), null);
Map<String, Object> resultMap = new HashMap<>();
resultMap.put("name", NAME);
resultMap.put("age", AGE);
resultMap.put("dateOfBirth", DATE);
when(result.asMap()).thenReturn(resultMap);
valueSetter = new GroupValueSetter(group, () -> reflectionCache);
}
use of org.mule.runtime.module.extension.internal.loader.java.type.runtime.TypeWrapper in project mule by mulesoft.
the class OperationReturnTypeModelValidatorTestCase method resultWithGenerics.
@Test
public void resultWithGenerics() {
when(methodElement.getReturnType()).thenReturn(new TypeWrapper(forType(new TypeToken<Result<?, ?>>() {
}.getType()), typeLoader));
validate(extensionModel, validator);
}
use of org.mule.runtime.module.extension.internal.loader.java.type.runtime.TypeWrapper in project mule by mulesoft.
the class OperationReturnTypeModelValidatorTestCase method muleMessageReturnType.
@Test(expected = IllegalModelDefinitionException.class)
public void muleMessageReturnType() {
when(methodElement.getReturnType()).thenReturn(new TypeWrapper(forType(new TypeToken<Message>() {
}.getType()), typeLoader));
validate(extensionModel, validator);
}
use of org.mule.runtime.module.extension.internal.loader.java.type.runtime.TypeWrapper in project mule by mulesoft.
the class OperationReturnTypeModelValidatorTestCase method resultListWithoutGenerics.
@Test(expected = IllegalModelDefinitionException.class)
public void resultListWithoutGenerics() {
when(methodElement.getReturnType()).thenReturn(new TypeWrapper(forType(new TypeToken<List<Result>>() {
}.getType()), typeLoader));
validate(extensionModel, validator);
}
Aggregations