Search in sources :

Example 6 with ParameterGroupModelProperty

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

the class ParameterGroupModelValidatorTestCase method invalidModelDueEmptyParameterGroup.

@Test(expected = IllegalModelDefinitionException.class)
public void invalidModelDueEmptyParameterGroup() {
    ParameterGroupDescriptor descriptor = new ParameterGroupDescriptor("name", new TypeWrapper(EmptyGroupPojo.class, typeLoader), null, mock(AnnotatedElement.class), null);
    when(groupModel.getModelProperty(ParameterGroupModelProperty.class)).thenReturn(of(new ParameterGroupModelProperty(descriptor)));
    validate(extensionModel, validator);
}
Also used : TypeWrapper(org.mule.runtime.module.extension.internal.loader.java.type.runtime.TypeWrapper) ParameterGroupDescriptor(org.mule.runtime.module.extension.internal.loader.ParameterGroupDescriptor) AnnotatedElement(java.lang.reflect.AnnotatedElement) ParameterGroupModelProperty(org.mule.runtime.module.extension.internal.loader.java.property.ParameterGroupModelProperty) SmallTest(org.mule.tck.size.SmallTest) Test(org.junit.Test)

Example 7 with ParameterGroupModelProperty

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

the class ParameterGroupModelValidatorTestCase method invalidModelDueToNonInstantiableParameterGroup.

@Test(expected = IllegalModelDefinitionException.class)
public void invalidModelDueToNonInstantiableParameterGroup() {
    TypeWrapper type = new TypeWrapper(Serializable.class, typeLoader);
    ParameterGroupDescriptor descriptor = new ParameterGroupDescriptor("name", type, null, mock(AnnotatedElement.class), null);
    when(groupModel.getModelProperty(ParameterGroupModelProperty.class)).thenReturn(of(new ParameterGroupModelProperty(descriptor)));
    when(groupModel.getParameterModels()).thenReturn(asList(parameterModel));
    validate(extensionModel, validator);
}
Also used : TypeWrapper(org.mule.runtime.module.extension.internal.loader.java.type.runtime.TypeWrapper) ParameterGroupDescriptor(org.mule.runtime.module.extension.internal.loader.ParameterGroupDescriptor) AnnotatedElement(java.lang.reflect.AnnotatedElement) ParameterGroupModelProperty(org.mule.runtime.module.extension.internal.loader.java.property.ParameterGroupModelProperty) SmallTest(org.mule.tck.size.SmallTest) Test(org.junit.Test)

Aggregations

ParameterGroupModelProperty (org.mule.runtime.module.extension.internal.loader.java.property.ParameterGroupModelProperty)7 ParameterGroupDescriptor (org.mule.runtime.module.extension.internal.loader.ParameterGroupDescriptor)6 AnnotatedElement (java.lang.reflect.AnnotatedElement)4 TypeWrapper (org.mule.runtime.module.extension.internal.loader.java.type.runtime.TypeWrapper)4 Test (org.junit.Test)3 SmallTest (org.mule.tck.size.SmallTest)3 Field (java.lang.reflect.Field)2 MetadataType (org.mule.metadata.api.model.MetadataType)2 ParameterGroupDeclarer (org.mule.runtime.api.meta.model.declaration.fluent.ParameterGroupDeclarer)2 ParameterGroupModel (org.mule.runtime.api.meta.model.parameter.ParameterGroupModel)2 DeclaringMemberModelProperty (org.mule.runtime.module.extension.internal.loader.java.property.DeclaringMemberModelProperty)2 NullSafeModelProperty (org.mule.runtime.module.extension.internal.loader.java.property.NullSafeModelProperty)2 String.format (java.lang.String.format)1 Annotation (java.lang.annotation.Annotation)1 ArrayList (java.util.ArrayList)1 Collections.emptyList (java.util.Collections.emptyList)1 List (java.util.List)1 Set (java.util.Set)1 Collectors.joining (java.util.stream.Collectors.joining)1 Collectors.toList (java.util.stream.Collectors.toList)1