use of org.mule.runtime.api.meta.model.parameter.ParameterModel in project mule by mulesoft.
the class NameClashModelValidatorTestCase method functionParameterClashesWithOperationParameter.
@Test
public void functionParameterClashesWithOperationParameter() {
ParameterModel param = getParameter(UNIQUE_PARAM_NAME + "1", ChildElementTest.class);
ParameterModel anotherParam = getParameter(UNIQUE_PARAM_NAME + "2", ChildElementTestClone.class);
when(param.getRole()).thenReturn(BEHAVIOUR);
when(anotherParam.getRole()).thenReturn(BEHAVIOUR);
when(operationModel.getAllParameterModels()).thenReturn(asList(param));
when(functionModel.getAllParameterModels()).thenReturn(asList(anotherParam));
mockParameterGroup(operationModel, asList(param));
mockParameterGroup(functionModel, asList(anotherParam));
validate();
}
use of org.mule.runtime.api.meta.model.parameter.ParameterModel in project mule by mulesoft.
the class NameClashModelValidatorTestCase method repeatedChildElementSupportNameAndChildElementSupportSameType.
@Test
public void repeatedChildElementSupportNameAndChildElementSupportSameType() {
ParameterModel firstParam = getParameter(UNIQUE_PARAM_NAME + "1", ChildElementTest.class);
ParameterModel secondParam = getParameter(UNIQUE_PARAM_NAME + "2", ChildElementTest.class);
when(firstParam.getRole()).thenReturn(BEHAVIOUR);
when(secondParam.getRole()).thenReturn(BEHAVIOUR);
when(operationModel.getAllParameterModels()).thenReturn(asList(firstParam, secondParam));
mockParameterGroup(operationModel, asList(firstParam, secondParam));
validate();
}
use of org.mule.runtime.api.meta.model.parameter.ParameterModel in project mule by mulesoft.
the class NameClashModelValidatorTestCase method repeatedContentParameterNameAndOperation.
@Test
public void repeatedContentParameterNameAndOperation() {
exception.expect(IllegalModelDefinitionException.class);
when(operationModel.getName()).thenReturn(REPEATED_NAME);
ParameterModel param = getParameter(REPEATED_NAME, ChildObjectTest.class);
when(param.getRole()).thenReturn(PRIMARY_CONTENT);
when(operationModel.getAllParameterModels()).thenReturn(asList(param));
validate();
}
use of org.mule.runtime.api.meta.model.parameter.ParameterModel in project mule by mulesoft.
the class NameClashModelValidatorTestCase method contentParametersWithSameNameAndTypeButDifferentRole.
@Test
public void contentParametersWithSameNameAndTypeButDifferentRole() {
exception.expect(IllegalModelDefinitionException.class);
ParameterModel firstParam = getParameter(CHILD_SINGULAR_PARAM_NAME, TopLevelTest.class);
when(firstParam.getRole()).thenReturn(PRIMARY_CONTENT);
ParameterModel secondParam = getParameter(CHILD_SINGULAR_PARAM_NAME, TopLevelTest.class);
when(secondParam.getRole()).thenReturn(BEHAVIOUR);
when(operationModel.getAllParameterModels()).thenReturn(asList(firstParam));
when(sourceModel.getAllParameterModels()).thenReturn(asList(secondParam));
validate();
}
use of org.mule.runtime.api.meta.model.parameter.ParameterModel in project mule by mulesoft.
the class NameClashModelValidatorTestCase method connectionProviderTopLevelParameterCrashesWithConfigName.
@Test
public void connectionProviderTopLevelParameterCrashesWithConfigName() {
exception.expect(IllegalModelDefinitionException.class);
ParameterModel offending = getParameter(CONFIG_NAME, TopLevelTest.class);
mockParameters(connectionProviderModel, simpleConnectionProviderParam, topLevelConnectionProviderParam, offending);
validate();
}
Aggregations