use of org.mule.runtime.module.extension.internal.loader.java.type.runtime.TypeWrapper in project mule by mulesoft.
the class OperationReturnTypeModelValidatorTestCase method resultWithoutGenerics.
@Test(expected = IllegalModelDefinitionException.class)
public void resultWithoutGenerics() {
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 completitionCallbackWithoutGenerics.
@Test(expected = IllegalModelDefinitionException.class)
public void completitionCallbackWithoutGenerics() {
when(methodElement.getReturnType()).thenReturn(new TypeWrapper(forType(new TypeToken<Void>() {
}.getType()), typeLoader));
ExtensionParameter completionCallbackParam = mock(ExtensionParameter.class);
when(completionCallbackParam.getType()).thenReturn(new TypeWrapper(forType(new TypeToken<CompletionCallback>() {
}.getType()), typeLoader));
when(methodElement.getParameters()).thenReturn(singletonList(completionCallbackParam));
validate(extensionModel, validator);
}
use of org.mule.runtime.module.extension.internal.loader.java.type.runtime.TypeWrapper in project mule by mulesoft.
the class ParameterGroupModelValidatorTestCase method invalidModelDueEmptyParameterGroup.
@Test(expected = IllegalModelDefinitionException.class)
public void invalidModelDueEmptyParameterGroup() {
ParameterGroupDescriptor descriptor = new ParameterGroupDescriptor("name", new TypeWrapper(EmptyGroupPojo.class, typeLoader), null, mock(AnnotatedElement.class), null);
when(groupModel.getModelProperty(ParameterGroupModelProperty.class)).thenReturn(of(new ParameterGroupModelProperty(descriptor)));
validate(extensionModel, validator);
}
use of org.mule.runtime.module.extension.internal.loader.java.type.runtime.TypeWrapper in project mule by mulesoft.
the class ParameterGroupModelValidatorTestCase method invalidModelDueToNonInstantiableParameterGroup.
@Test(expected = IllegalModelDefinitionException.class)
public void invalidModelDueToNonInstantiableParameterGroup() {
TypeWrapper type = new TypeWrapper(Serializable.class, typeLoader);
ParameterGroupDescriptor descriptor = new ParameterGroupDescriptor("name", type, null, mock(AnnotatedElement.class), null);
when(groupModel.getModelProperty(ParameterGroupModelProperty.class)).thenReturn(of(new ParameterGroupModelProperty(descriptor)));
when(groupModel.getParameterModels()).thenReturn(asList(parameterModel));
validate(extensionModel, validator);
}
Aggregations