use of org.mule.runtime.api.meta.model.ExtensionModel in project mule by mulesoft.
the class DefaultExtensionModelFactoryTestCase method streamingHintOnOperation.
@Test
public void streamingHintOnOperation() throws Exception {
ExtensionModel extensionModel = createExtension(HeisenbergExtension.class);
OperationModel operationModel = extensionModel.getConfigurationModels().get(0).getOperationModel("sayMyName").get();
ParameterModel streamingParameter = operationModel.getAllParameterModels().stream().filter(p -> p.getName().equals(STREAMING_STRATEGY_PARAMETER_NAME)).findFirst().get();
assertStreamingStrategy(streamingParameter);
}
use of org.mule.runtime.api.meta.model.ExtensionModel in project mule by mulesoft.
the class DefaultExtensionModelFactoryTestCase method untesteableConnetionProvider.
@Test
public void untesteableConnetionProvider() throws Exception {
ExtensionModel extensionModel = createExtension(VeganExtension.class);
ConnectionProviderModel connectionProviderModel = extensionModel.getConfigurationModel(APPLE).map(c -> c.getConnectionProviders().get(0)).get();
assertThat(connectionProviderModel.supportsConnectivityTesting(), is(false));
}
use of org.mule.runtime.api.meta.model.ExtensionModel in project mule by mulesoft.
the class DefaultExtensionModelFactoryTestCase method sourceWithFixedBackPressureStrategy.
@Test
public void sourceWithFixedBackPressureStrategy() {
ExtensionModel extensionModel = createExtension(HeisenbergExtension.class);
SourceModel source = extensionModel.getSourceModels().get(0);
Optional<ParameterModel> parameter = source.getAllParameterModels().stream().filter(p -> BACK_PRESSURE_STRATEGY_PARAMETER_NAME.equals(p.getName())).findAny();
assertThat(parameter.isPresent(), is(false));
}
use of org.mule.runtime.api.meta.model.ExtensionModel in project mule by mulesoft.
the class DefaultExtensionModelFactoryTestCase method sourceWithDefaultBackPressureStrategies.
@Test
public void sourceWithDefaultBackPressureStrategies() {
ExtensionModel extensionModel = createExtension(HeisenbergExtension.class);
SourceModel source = extensionModel.getConfigurationModels().get(0).getSourceModel("ReconnectableListenPayments").get();
Optional<ParameterModel> parameter = source.getAllParameterModels().stream().filter(p -> BACK_PRESSURE_STRATEGY_PARAMETER_NAME.equals(p.getName())).findAny();
assertThat(parameter.isPresent(), is(false));
}
use of org.mule.runtime.api.meta.model.ExtensionModel in project mule by mulesoft.
the class DefaultExtensionManagerTestCase method contextClassLoaderKeptAfterException.
@Test
public void contextClassLoaderKeptAfterException() {
ExtensionModel extensionModel = mock(ExtensionModel.class);
when(extensionModel.getName()).thenThrow(new RuntimeException());
try {
extensionsManager.registerExtension(extensionModel);
fail("was expecting an exception");
} catch (RuntimeException e) {
assertThat(classLoader, sameInstance(Thread.currentThread().getContextClassLoader()));
}
}
Aggregations