Search in sources :

Example 6 with ImplementingMethodModelProperty

use of org.mule.runtime.module.extension.internal.loader.java.property.ImplementingMethodModelProperty in project mule by mulesoft.

the class ExportedPackagesValidatorTestCase method withMethod.

private void withMethod(OperationModel operationModel, Optional<Method> optionalMethod) {
    when(operationModel.getModelProperty(ImplementingMethodModelProperty.class)).thenReturn(optionalMethod.map(ImplementingMethodModelProperty::new));
    when(operationModel.getModelProperty(ExtensionOperationDescriptorModelProperty.class)).thenReturn(optionalMethod.map(method -> new ExtensionOperationDescriptorModelProperty(new MethodWrapper(method, loader))));
}
Also used : CoreMatchers.is(org.hamcrest.CoreMatchers.is) Optional.empty(java.util.Optional.empty) ParameterModel(org.mule.runtime.api.meta.model.parameter.ParameterModel) OperationModel(org.mule.runtime.api.meta.model.operation.OperationModel) Apple(org.mule.tck.testmodels.fruit.Apple) MethodWrapper(org.mule.runtime.module.extension.internal.loader.java.type.runtime.MethodWrapper) Mock(org.mockito.Mock) Optional.of(java.util.Optional.of) ExtensionsTypeLoaderFactory(org.mule.runtime.extension.api.declaration.type.ExtensionsTypeLoaderFactory) CoreMatchers.not(org.hamcrest.CoreMatchers.not) RunWith(org.junit.runner.RunWith) Shape(org.mule.test.metadata.extension.model.shapes.Shape) TypeToken(com.google.common.reflect.TypeToken) IsEmptyCollection(org.hamcrest.collection.IsEmptyCollection) ExtensionsTestUtils.mockParameters(org.mule.test.module.extension.internal.util.ExtensionsTestUtils.mockParameters) Arrays.asList(java.util.Arrays.asList) ExtensionModelTestUtils.visitableMock(org.mule.runtime.api.util.ExtensionModelTestUtils.visitableMock) MatcherAssert.assertThat(org.hamcrest.MatcherAssert.assertThat) IntrospectionUtils.getApiMethods(org.mule.runtime.module.extension.internal.util.IntrospectionUtils.getApiMethods) ClassTypeLoader(org.mule.metadata.api.ClassTypeLoader) Problem(org.mule.runtime.extension.api.loader.Problem) ApiTestClass(org.mule.test.module.extension.api.ApiTestClass) Method(java.lang.reflect.Method) VeganAttributes(org.mule.test.vegan.extension.VeganAttributes) Before(org.junit.Before) CoreMatchers.containsString(org.hamcrest.CoreMatchers.containsString) ProblemsReporter(org.mule.runtime.extension.api.loader.ProblemsReporter) Test(org.junit.Test) Mockito.when(org.mockito.Mockito.when) ClassLoaderModelProperty(org.mule.runtime.extension.api.property.ClassLoaderModelProperty) InternalTestClass(org.mule.test.module.extension.internal.InternalTestClass) Result(org.mule.runtime.extension.api.runtime.operation.Result) ExtensionModel(org.mule.runtime.api.meta.model.ExtensionModel) List(java.util.List) MockitoJUnitRunner(org.mockito.runners.MockitoJUnitRunner) Type(java.lang.reflect.Type) OutputModel(org.mule.runtime.api.meta.model.OutputModel) Optional(java.util.Optional) ImplementingMethodModelProperty(org.mule.runtime.module.extension.internal.loader.java.property.ImplementingMethodModelProperty) ExtensionOperationDescriptorModelProperty(org.mule.runtime.module.extension.internal.loader.java.type.property.ExtensionOperationDescriptorModelProperty) Mockito.mock(org.mockito.Mockito.mock) ExtensionOperationDescriptorModelProperty(org.mule.runtime.module.extension.internal.loader.java.type.property.ExtensionOperationDescriptorModelProperty) MethodWrapper(org.mule.runtime.module.extension.internal.loader.java.type.runtime.MethodWrapper)

Aggregations

ImplementingMethodModelProperty (org.mule.runtime.module.extension.internal.loader.java.property.ImplementingMethodModelProperty)6 Method (java.lang.reflect.Method)5 ExtensionOperationDescriptorModelProperty (org.mule.runtime.module.extension.internal.loader.java.type.property.ExtensionOperationDescriptorModelProperty)5 ExtensionParameter (org.mule.runtime.module.extension.api.loader.java.type.ExtensionParameter)4 ParameterDeclarationContext (org.mule.runtime.module.extension.internal.loader.utils.ParameterDeclarationContext)4 Arrays.asList (java.util.Arrays.asList)3 List (java.util.List)3 Optional (java.util.Optional)3 Declarer (org.mule.runtime.api.meta.model.declaration.fluent.Declarer)3 ExtensionDeclarer (org.mule.runtime.api.meta.model.declaration.fluent.ExtensionDeclarer)3 HasOperationDeclarer (org.mule.runtime.api.meta.model.declaration.fluent.HasOperationDeclarer)3 ComponentExecutorModelProperty (org.mule.runtime.module.extension.api.loader.java.property.ComponentExecutorModelProperty)3 ReflectiveOperationExecutorFactory (org.mule.runtime.module.extension.internal.runtime.execution.ReflectiveOperationExecutorFactory)3 TypeToken (com.google.common.reflect.TypeToken)2 Type (java.lang.reflect.Type)2 Optional.empty (java.util.Optional.empty)2 Optional.of (java.util.Optional.of)2 MatcherAssert.assertThat (org.hamcrest.MatcherAssert.assertThat)2 Before (org.junit.Before)2 Test (org.junit.Test)2