Search in sources :

Example 1 with ConnectivityModelProperty

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

the class SoapInvokeOperationDeclarer method declare.

/**
 * Declares the invoke operation.
 *
 * @param configDeclarer the soap config declarer
 * @param loader         a {@link ClassTypeLoader} to load some parameters types.
 * @param soapErrors     the {@link ErrorModel}s that this operation can throw.
 */
void declare(ConfigurationDeclarer configDeclarer, ClassTypeLoader loader, Set<ErrorModel> soapErrors) {
    ReflectionCache reflectionCache = new ReflectionCache();
    OperationDeclarer operation = configDeclarer.withOperation(OPERATION_NAME).describedAs(OPERATION_DESCRIPTION).requiresConnection(true).blocking(true).withModelProperty(new ComponentExecutorModelProperty(new SoapOperationExecutorFactory())).withModelProperty(new ConnectivityModelProperty(ForwardingSoapClient.class));
    soapErrors.forEach(operation::withErrorModel);
    declareMetadata(operation, loader);
    declareOutput(operation, loader);
    declareMetadataKeyParameters(operation, loader, reflectionCache);
    declareRequestParameters(operation, loader);
}
Also used : ConnectivityModelProperty(org.mule.runtime.module.extension.internal.loader.java.property.ConnectivityModelProperty) ForwardingSoapClient(org.mule.runtime.module.extension.soap.internal.runtime.connection.ForwardingSoapClient) ReflectionCache(org.mule.runtime.module.extension.internal.util.ReflectionCache) OperationDeclarer(org.mule.runtime.api.meta.model.declaration.fluent.OperationDeclarer) SoapOperationExecutorFactory(org.mule.runtime.module.extension.soap.internal.runtime.operation.SoapOperationExecutorFactory) ComponentExecutorModelProperty(org.mule.runtime.module.extension.api.loader.java.property.ComponentExecutorModelProperty)

Example 2 with ConnectivityModelProperty

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

the class ConfigurationInstanceFactoryTestCase method before.

@Before
public void before() throws Exception {
    mockConfigurationInstance(configurationModel, new TestConfig());
    mockInterceptors(configurationModel, asList(() -> interceptor1, () -> interceptor2));
    when(configurationModel.getOperationModels()).thenReturn(ImmutableList.of());
    when(configurationModel.getSourceModels()).thenReturn(ImmutableList.of());
    when(extensionModel.getOperationModels()).thenReturn(asList(operationModel));
    when(extensionModel.getSourceModels()).thenReturn(asList(sourceModel));
    when(operationModel.getModelProperty(ConnectivityModelProperty.class)).thenReturn(of(new ConnectivityModelProperty(Banana.class)));
    when(sourceModel.getModelProperty(ConnectivityModelProperty.class)).thenReturn(of(new ConnectivityModelProperty(Banana.class)));
    when(sourceModel.getErrorCallback()).thenReturn(of(sourceCallbackModel));
    when(sourceModel.getSuccessCallback()).thenReturn(of(sourceCallbackModel));
    when(muleContext.getConfiguration().getDefaultEncoding()).thenReturn(ENCODING);
    resolverSet = ConfigurationObjectBuilderTestCase.createResolverSet();
    factory = new ConfigurationInstanceFactory<>(extensionModel, configurationModel, resolverSet, new ReflectionCache(), muleContext);
}
Also used : ConnectivityModelProperty(org.mule.runtime.module.extension.internal.loader.java.property.ConnectivityModelProperty) TestConfig(org.mule.runtime.module.extension.internal.runtime.execution.ConfigurationObjectBuilderTestCase.TestConfig) ReflectionCache(org.mule.runtime.module.extension.internal.util.ReflectionCache) Before(org.junit.Before)

Aggregations

ConnectivityModelProperty (org.mule.runtime.module.extension.internal.loader.java.property.ConnectivityModelProperty)2 ReflectionCache (org.mule.runtime.module.extension.internal.util.ReflectionCache)2 Before (org.junit.Before)1 OperationDeclarer (org.mule.runtime.api.meta.model.declaration.fluent.OperationDeclarer)1 ComponentExecutorModelProperty (org.mule.runtime.module.extension.api.loader.java.property.ComponentExecutorModelProperty)1 TestConfig (org.mule.runtime.module.extension.internal.runtime.execution.ConfigurationObjectBuilderTestCase.TestConfig)1 ForwardingSoapClient (org.mule.runtime.module.extension.soap.internal.runtime.connection.ForwardingSoapClient)1 SoapOperationExecutorFactory (org.mule.runtime.module.extension.soap.internal.runtime.operation.SoapOperationExecutorFactory)1