Search in sources :

Example 1 with CraftedExtensionModelLoader

use of org.mule.runtime.module.extension.api.loader.java.CraftedExtensionModelLoader in project mule by mulesoft.

the class CraftedExtensionModelLoaderTestCase method spiDiscoverable.

@Test
public void spiDiscoverable() throws Exception {
    ServiceRegistry registry = new SpiServiceRegistry();
    Optional<ExtensionModelLoader> craftedLoader = registry.lookupProviders(ExtensionModelLoader.class, classLoader).stream().filter(p -> p instanceof CraftedExtensionModelLoader).findAny();
    assertThat(craftedLoader.isPresent(), is(true));
}
Also used : CoreMatchers.is(org.hamcrest.CoreMatchers.is) Mock(org.mockito.Mock) RunWith(org.junit.runner.RunWith) HashMap(java.util.HashMap) CoreMatchers.notNullValue(org.hamcrest.CoreMatchers.notNullValue) SpiServiceRegistry(org.mule.runtime.core.api.registry.SpiServiceRegistry) Assert.assertThat(org.junit.Assert.assertThat) AbstractMuleTestCase(org.mule.tck.junit4.AbstractMuleTestCase) SmallTest(org.mule.tck.size.SmallTest) Map(java.util.Map) ExpectedException.none(org.junit.rules.ExpectedException.none) DslResolvingContext(org.mule.runtime.api.dsl.DslResolvingContext) ExtensionLoadingDelegate(org.mule.runtime.extension.api.loader.ExtensionLoadingDelegate) ServiceRegistry(org.mule.runtime.core.api.registry.ServiceRegistry) ExtensionModelLoader(org.mule.runtime.extension.api.loader.ExtensionModelLoader) ExpectedException(org.junit.rules.ExpectedException) Before(org.junit.Before) COMMUNITY(org.mule.runtime.api.meta.Category.COMMUNITY) ExtensionLoadingContext(org.mule.runtime.extension.api.loader.ExtensionLoadingContext) Test(org.junit.Test) TYPE_PROPERTY_NAME(org.mule.runtime.module.extension.api.loader.java.CraftedExtensionModelLoader.TYPE_PROPERTY_NAME) CraftedExtensionModelLoader(org.mule.runtime.module.extension.api.loader.java.CraftedExtensionModelLoader) ExtensionModel(org.mule.runtime.api.meta.model.ExtensionModel) MuleVersion(org.mule.runtime.api.meta.MuleVersion) Rule(org.junit.Rule) MockitoJUnitRunner(org.mockito.runners.MockitoJUnitRunner) Optional(java.util.Optional) ExtensionDeclarer(org.mule.runtime.api.meta.model.declaration.fluent.ExtensionDeclarer) CraftedExtensionModelLoader(org.mule.runtime.module.extension.api.loader.java.CraftedExtensionModelLoader) ExtensionModelLoader(org.mule.runtime.extension.api.loader.ExtensionModelLoader) CraftedExtensionModelLoader(org.mule.runtime.module.extension.api.loader.java.CraftedExtensionModelLoader) SpiServiceRegistry(org.mule.runtime.core.api.registry.SpiServiceRegistry) ServiceRegistry(org.mule.runtime.core.api.registry.ServiceRegistry) SpiServiceRegistry(org.mule.runtime.core.api.registry.SpiServiceRegistry) SmallTest(org.mule.tck.size.SmallTest) Test(org.junit.Test)

Aggregations

HashMap (java.util.HashMap)1 Map (java.util.Map)1 Optional (java.util.Optional)1 CoreMatchers.is (org.hamcrest.CoreMatchers.is)1 CoreMatchers.notNullValue (org.hamcrest.CoreMatchers.notNullValue)1 Assert.assertThat (org.junit.Assert.assertThat)1 Before (org.junit.Before)1 Rule (org.junit.Rule)1 Test (org.junit.Test)1 ExpectedException (org.junit.rules.ExpectedException)1 ExpectedException.none (org.junit.rules.ExpectedException.none)1 RunWith (org.junit.runner.RunWith)1 Mock (org.mockito.Mock)1 MockitoJUnitRunner (org.mockito.runners.MockitoJUnitRunner)1 DslResolvingContext (org.mule.runtime.api.dsl.DslResolvingContext)1 COMMUNITY (org.mule.runtime.api.meta.Category.COMMUNITY)1 MuleVersion (org.mule.runtime.api.meta.MuleVersion)1 ExtensionModel (org.mule.runtime.api.meta.model.ExtensionModel)1 ExtensionDeclarer (org.mule.runtime.api.meta.model.declaration.fluent.ExtensionDeclarer)1 ServiceRegistry (org.mule.runtime.core.api.registry.ServiceRegistry)1