use of org.mule.runtime.api.dsl.DslResolvingContext.getDefault in project mule by mulesoft.
the class ExtensionsTestInfrastructureDiscoverer method generateDslResources.
public List<GeneratedResource> generateDslResources(File generatedResourcesDirectory, ExtensionModel forExtensionModel) {
DslResolvingContext context;
if (extensionManager.getExtensions().stream().anyMatch(e -> !e.getImportedTypes().isEmpty())) {
HashSet<ExtensionModel> models = new HashSet<>(extensionManager.getExtensions());
models.add(MuleExtensionModelProvider.getExtensionModel());
context = DslResolvingContext.getDefault(models);
} else {
context = new NullDslResolvingContext();
}
ExtensionsTestDslResourcesGenerator dslResourceGenerator = new ExtensionsTestDslResourcesGenerator(getDslResourceFactories(), generatedResourcesDirectory, context);
extensionManager.getExtensions().stream().filter(runtimeExtensionModel -> forExtensionModel != null ? runtimeExtensionModel.equals(forExtensionModel) : true).forEach(dslResourceGenerator::generateFor);
return dslResourceGenerator.dumpAll();
}
Aggregations