use of org.mule.runtime.extension.api.stereotype.MuleStereotypes.ERROR_HANDLER in project mule by mulesoft.
the class CoreExtensionModelTestCase method flow.
@Test
public void flow() {
final ConstructModel flow = coreExtensionModel.getConstructModel("flow").get();
assertThat(flow.getStereotype().getType(), is(FLOW.getType()));
assertThat(flow.allowsTopLevelDeclaration(), is(true));
final List<ParameterModel> paramModels = flow.getAllParameterModels();
assertThat(paramModels, hasSize(2));
ParameterModel initialState = paramModels.get(0);
assertThat(initialState.getName(), is("initialState"));
assertThat(initialState.getDefaultValue(), is("started"));
ParameterModel maxConcurrency = paramModels.get(1);
assertThat(maxConcurrency.getName(), is("maxConcurrency"));
List<? extends NestableElementModel> nestedComponents = flow.getNestedComponents();
assertThat(nestedComponents, hasSize(3));
NestableElementModel source = nestedComponents.get(0);
assertThat(source.getName(), is("source"));
assertThat(source.isRequired(), is(false));
assertThat(source, instanceOf(NestedComponentModel.class));
assertThat(((NestedComponentModel) source).getAllowedStereotypes(), contains(SOURCE));
NestableElementModel chain = nestedComponents.get(1);
assertThat(chain.getName(), is("processors"));
assertThat(chain.isRequired(), is(true));
assertThat(chain, instanceOf(NestedChainModel.class));
assertThat(((NestedChainModel) chain).getAllowedStereotypes().stream().anyMatch(s -> s.getType().equals(PROCESSOR.getType())), is(true));
NestableElementModel errorHandler = nestedComponents.get(2);
assertThat(errorHandler.getName(), is("errorHandler"));
assertThat(errorHandler.isRequired(), is(false));
assertThat(errorHandler, instanceOf(NestedComponentModel.class));
assertThat(((NestedComponentModel) errorHandler).getAllowedStereotypes(), contains(ERROR_HANDLER));
}
Aggregations