use of org.mule.runtime.api.meta.model.declaration.fluent.ExtensionDeclarer in project mule by mulesoft.
the class ConnectionDeclarationEnricherTestCase method before.
@Before
public void before() throws Exception {
connectedOperation = spy(new ExtensionDeclarer().withOperation(CONNECTED_OPERATION).requiresConnection(true).getDeclaration());
notConnectedOperation = spy(new ExtensionDeclarer().withOperation(NOT_CONNECTED_OPERATION).requiresConnection(false).getDeclaration());
when(extensionLoadingContext.getExtensionDeclarer()).thenReturn(extensionDeclarer);
when(extensionDeclarer.getDeclaration()).thenReturn(extensionDeclaration);
when(extensionDeclaration.getOperations()).thenReturn(asList(connectedOperation, notConnectedOperation));
}
use of org.mule.runtime.api.meta.model.declaration.fluent.ExtensionDeclarer in project mule by mulesoft.
the class DynamicMetadataDeclarationEnricherTestCase method setUp.
@Before
public void setUp() {
DefaultJavaModelLoaderDelegate loader = new DefaultJavaModelLoaderDelegate(MetadataExtension.class, getProductVersion());
ExtensionDeclarer declarer = loader.declare(new DefaultExtensionLoadingContext(getClass().getClassLoader(), getDefault(emptySet())));
new DynamicMetadataDeclarationEnricher().enrich(new DefaultExtensionLoadingContext(declarer, this.getClass().getClassLoader(), getDefault(emptySet())));
declaration = declarer.getDeclaration();
}
use of org.mule.runtime.api.meta.model.declaration.fluent.ExtensionDeclarer in project mule by mulesoft.
the class LayoutModelTestCase method parseLayoutAnnotationsOnParameter.
@Test
public void parseLayoutAnnotationsOnParameter() {
ExtensionDeclarer declarer = declareExtension();
ExtensionDeclaration extensionDeclaration = declarer.getDeclaration();
final ConfigurationDeclaration configurationDeclaration = extensionDeclaration.getConfigurations().get(0);
assertParameterPlacement(findParameterInGroup(configurationDeclaration, "labeledRicin"), RICIN_GROUP_NAME, 1);
assertParameterPlacement(findParameterInGroup(configurationDeclaration, "ricinPacks"), RICIN_GROUP_NAME, 2);
}
use of org.mule.runtime.api.meta.model.declaration.fluent.ExtensionDeclarer in project mule by mulesoft.
the class LayoutModelTestCase method parseLayoutAnnotationsOnOperationParameter.
@Test
public void parseLayoutAnnotationsOnOperationParameter() {
ExtensionDeclarer declarer = declareExtension();
ExtensionDeclaration extensionDeclaration = declarer.getDeclaration();
OperationDeclaration operation = getOperation(extensionDeclaration, KILL_CUSTOM_OPERATION);
assertThat(operation, is(notNullValue()));
assertParameterPlacement(findParameterInGroup(operation, "victim"), KILL_WITH_GROUP, 1);
assertParameterPlacement(findParameterInGroup(operation, "goodbyeMessage"), KILL_WITH_GROUP, 2);
}
use of org.mule.runtime.api.meta.model.declaration.fluent.ExtensionDeclarer in project mule by mulesoft.
the class LayoutModelTestCase method parseLayoutAnnotationsOnParameterGroup.
@Test
public void parseLayoutAnnotationsOnParameterGroup() {
ExtensionDeclarer declarer = declareExtension();
ExtensionDeclaration extensionDeclaration = declarer.getDeclaration();
ConfigurationDeclaration config = extensionDeclaration.getConfigurations().get(0);
assertParameterPlacement(findParameterInGroup(config, "myName"), PERSONAL_INFORMATION_GROUP_NAME, 1);
assertParameterPlacement(findParameterInGroup(config, "age"), PERSONAL_INFORMATION_GROUP_NAME, 2);
assertParameterPlacement(findParameterInGroup(config, "dateOfConception"), PERSONAL_INFORMATION_GROUP_NAME, 3);
assertParameterPlacement(findParameterInGroup(config, "dateOfBirth"), PERSONAL_INFORMATION_GROUP_NAME, 4);
assertParameterPlacement(findParameterInGroup(config, "dateOfDeath"), PERSONAL_INFORMATION_GROUP_NAME, 5);
}
Aggregations