use of org.mule.runtime.api.meta.model.parameter.ParameterModel in project mule by mulesoft.
the class ComplexExtensionDeclarationTestCase method staticResourceOperation.
@Test
public void staticResourceOperation() {
OperationModel operation = extensionModel.getOperationModel(STATIC_RESOURCE_OPERATION_NAME).get();
assertThat(operation.getName(), is(STATIC_RESOURCE_OPERATION_NAME));
assertType(operation.getOutput().getType(), InputStream.class, BinaryType.class);
final List<ParameterModel> parameters = operation.getAllParameterModels();
assertThat(parameters, hasSize(4));
assertStreamingStrategyParameter(parameters.get(0));
ParameterModel parameter = parameters.get(1);
assertThat(parameter.getName(), is(PATH));
assertType(parameter.getType(), String.class, StringType.class);
assertTargetParameter(parameters.get(2), parameters.get(3));
}
use of org.mule.runtime.api.meta.model.parameter.ParameterModel in project mule by mulesoft.
the class ComplexExtensionDeclarationTestCase method listenerSource.
@Test
public void listenerSource() {
SourceModel source = extensionModel.getConfigurationModel(LISTENER_CONFIG_NAME).get().getSourceModel(LISTEN_MESSAGE_SOURCE).get();
assertType(source.getOutput().getType(), InputStream.class, BinaryType.class);
assertType(source.getOutputAttributes().getType(), Serializable.class, ObjectType.class);
List<ParameterModel> parameters = source.getAllParameterModels();
assertThat(parameters, hasSize(2));
ParameterModel parameter = parameters.get(0);
assertStreamingStrategyParameter(parameter);
parameter = parameters.get(1);
assertThat(parameter.getName(), is(PORT));
assertThat(parameter.isRequired(), is(false));
assertType(parameter.getType(), Integer.class, NumberType.class);
}
use of org.mule.runtime.api.meta.model.parameter.ParameterModel in project mule by mulesoft.
the class ComplexExtensionDeclarationTestCase method requestOperation.
@Test
public void requestOperation() {
OperationModel operation = extensionModel.getConfigurationModel(REQUESTER_CONFIG_NAME).get().getOperationModel(REQUEST_OPERATION_NAME).get();
assertThat(operation.getName(), is(REQUEST_OPERATION_NAME));
assertType(operation.getOutput().getType(), InputStream.class, BinaryType.class);
List<ParameterModel> parameterModels = operation.getAllParameterModels();
assertThat(parameterModels, hasSize(4));
ParameterModel parameter = parameterModels.get(0);
assertStreamingStrategyParameter(parameter);
parameter = parameterModels.get(1);
assertThat(parameter.getName(), is(PATH));
assertType(parameter.getType(), String.class, StringType.class);
assertTargetParameter(parameterModels.get(2), parameterModels.get(3));
}
use of org.mule.runtime.api.meta.model.parameter.ParameterModel in project mule by mulesoft.
the class DefaultExtensionModelFactoryTestCase method streamingHintOnOperation.
@Test
public void streamingHintOnOperation() throws Exception {
ExtensionModel extensionModel = createExtension(HeisenbergExtension.class);
OperationModel operationModel = extensionModel.getConfigurationModels().get(0).getOperationModel("sayMyName").get();
ParameterModel streamingParameter = operationModel.getAllParameterModels().stream().filter(p -> p.getName().equals(STREAMING_STRATEGY_PARAMETER_NAME)).findFirst().get();
assertStreamingStrategy(streamingParameter);
}
use of org.mule.runtime.api.meta.model.parameter.ParameterModel in project mule by mulesoft.
the class DefaultExtensionModelFactoryTestCase method sourceWithFixedBackPressureStrategy.
@Test
public void sourceWithFixedBackPressureStrategy() {
ExtensionModel extensionModel = createExtension(HeisenbergExtension.class);
SourceModel source = extensionModel.getSourceModels().get(0);
Optional<ParameterModel> parameter = source.getAllParameterModels().stream().filter(p -> BACK_PRESSURE_STRATEGY_PARAMETER_NAME.equals(p.getName())).findAny();
assertThat(parameter.isPresent(), is(false));
}
Aggregations