Search in sources :

Example 11 with ExtensionParameter

use of org.mule.runtime.module.extension.api.loader.java.type.ExtensionParameter 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);
}
Also used : TypeWrapper(org.mule.runtime.module.extension.internal.loader.java.type.runtime.TypeWrapper) ExtensionParameter(org.mule.runtime.module.extension.api.loader.java.type.ExtensionParameter) TypeToken(com.google.common.reflect.TypeToken) SmallTest(org.mule.tck.size.SmallTest) Test(org.junit.Test)

Aggregations

ExtensionParameter (org.mule.runtime.module.extension.api.loader.java.type.ExtensionParameter)11 Declarer (org.mule.runtime.api.meta.model.declaration.fluent.Declarer)6 ParameterDeclarationContext (org.mule.runtime.module.extension.internal.loader.utils.ParameterDeclarationContext)6 ExtensionDeclarer (org.mule.runtime.api.meta.model.declaration.fluent.ExtensionDeclarer)5 String.format (java.lang.String.format)4 Method (java.lang.reflect.Method)4 List (java.util.List)4 HasOperationDeclarer (org.mule.runtime.api.meta.model.declaration.fluent.HasOperationDeclarer)4 ImplementingMethodModelProperty (org.mule.runtime.module.extension.internal.loader.java.property.ImplementingMethodModelProperty)4 ExtensionOperationDescriptorModelProperty (org.mule.runtime.module.extension.internal.loader.java.type.property.ExtensionOperationDescriptorModelProperty)4 Optional (java.util.Optional)3 Collectors.toList (java.util.stream.Collectors.toList)3 MetadataType (org.mule.metadata.api.model.MetadataType)3 OperationDeclarer (org.mule.runtime.api.meta.model.declaration.fluent.OperationDeclarer)3 ParameterDeclarer (org.mule.runtime.api.meta.model.declaration.fluent.ParameterDeclarer)3 ComponentExecutorModelProperty (org.mule.runtime.module.extension.api.loader.java.property.ComponentExecutorModelProperty)3 ImplementingTypeModelProperty (org.mule.runtime.module.extension.internal.loader.java.property.ImplementingTypeModelProperty)3 ReflectiveOperationExecutorFactory (org.mule.runtime.module.extension.internal.runtime.execution.ReflectiveOperationExecutorFactory)3 Annotation (java.lang.annotation.Annotation)2 Field (java.lang.reflect.Field)2