use of org.mule.runtime.api.meta.model.parameter.ParameterModel in project mule by mulesoft.
the class NameClashModelValidatorTestCase method listSingularizeClashOnTopLevelParameterDifferentType.
@Test
public void listSingularizeClashOnTopLevelParameterDifferentType() {
exception.expect(IllegalModelDefinitionException.class);
ParameterModel offending = getParameter(CHILD_PLURAL_PARAM_NAME, childTestList);
ParameterModel singular = getParameter(CHILD_SINGULAR_PARAM_NAME, TopLevelTest.class);
when(operationModel.getAllParameterModels()).thenReturn(asList(singular, offending));
validate();
}
use of org.mule.runtime.api.meta.model.parameter.ParameterModel in project mule by mulesoft.
the class NameClashModelValidatorTestCase method repeatedChildElementSupportNameAndSource.
@Test
public void repeatedChildElementSupportNameAndSource() {
exception.expect(IllegalModelDefinitionException.class);
when(sourceModel.getName()).thenReturn(REPEATED_NAME);
ParameterModel param = getParameter(UNIQUE_PARAM_NAME, ChildElementTest.class);
when(param.getRole()).thenReturn(BEHAVIOUR);
when(operationModel.getAllParameterModels()).thenReturn(asList(param));
mockParameterGroup(operationModel, asList(param));
validate();
}
use of org.mule.runtime.api.meta.model.parameter.ParameterModel in project mule by mulesoft.
the class NameClashModelValidatorTestCase method notInlineDefinitionPassSuccessful.
@Test
public void notInlineDefinitionPassSuccessful() {
ParameterModel offending = getParameter(CHILD_PLURAL_PARAM_NAME, childTestList);
ParameterModel singular = getParameter(CHILD_SINGULAR_PARAM_NAME, NoChildTest.class);
when(configurationModel.getAllParameterModels()).thenReturn(singletonList(offending));
when(operationModel.getName()).thenReturn("mapSingularizeClash");
when(operationModel.getAllParameterModels()).thenReturn(singletonList(singular));
validate();
}
use of org.mule.runtime.api.meta.model.parameter.ParameterModel in project mule by mulesoft.
the class NameClashModelValidatorTestCase method configParameterWithRepeatedName.
@Test
public void configParameterWithRepeatedName() {
exception.expect(IllegalModelDefinitionException.class);
ParameterModel offending = getParameter(TOP_LEVEL_OPERATION_PARAM_NAME, Banana.class);
mockParameters(configurationModel, simpleConfigParam, topLevelConfigParam, offending);
validate();
}
use of org.mule.runtime.api.meta.model.parameter.ParameterModel in project mule by mulesoft.
the class NameClashModelValidatorTestCase method listSingularizeClashOnTopLevelParameterDifferentTypeOnConstruct.
@Test
public void listSingularizeClashOnTopLevelParameterDifferentTypeOnConstruct() {
exception.expect(IllegalModelDefinitionException.class);
ParameterModel offending = getParameter(CHILD_PLURAL_PARAM_NAME, childTestList);
ParameterModel singular = getParameter(CHILD_SINGULAR_PARAM_NAME, ChildObjectTest.class);
when(constructModel.getAllParameterModels()).thenReturn(asList(singular, offending));
validate();
}
Aggregations