use of org.mule.runtime.core.internal.util.EnumerationAdapter in project mule by mulesoft.
the class ClasspathModuleDiscovererTestCase method discoversModuleWithExportedServices.
@Test
public void discoversModuleWithExportedServices() throws Exception {
List<URL> moduleProperties = new ArrayList();
moduleProperties.add(getClass().getClassLoader().getResource("moduleExportedServices.properties"));
when(classLoader.getResources(ClasspathModuleDiscoverer.MODULE_PROPERTIES)).thenReturn(new EnumerationAdapter(moduleProperties));
List<MuleModule> muleModules = moduleDiscoverer.discover();
assertThat(muleModules, hasSize(1));
MuleModule muleModule = muleModules.get(0);
assertThat(muleModule.getName(), is("moduleExportedServices"));
assertThat(muleModule.getExportedPackages(), is(empty()));
assertThat(muleModule.getExportedPaths(), is(empty()));
assertThat(muleModule.getPrivilegedExportedPackages(), is(empty()));
assertThat(muleModule.getPrivilegedArtifacts(), is(empty()));
assertThat(muleModule.getExportedServices().size(), equalTo(3));
assertThat(muleModule.getExportedServices().get(0).getServiceInterface(), equalTo("org.foo.ServiceInterface"));
assertThat(muleModule.getExportedServices().get(1).getServiceInterface(), equalTo("org.foo.ServiceInterface"));
assertThat(muleModule.getExportedServices().get(2).getServiceInterface(), equalTo("org.bar.ServiceInterface"));
}
Aggregations