Search in sources :

Example 6 with ServiceProvider

use of org.mule.runtime.api.service.ServiceProvider in project mule by mulesoft.

the class ReflectionServiceResolverTestCase method createFooServiceProvider.

private Pair<ArtifactClassLoader, ServiceProvider> createFooServiceProvider(FooService fooService) {
    ServiceProvider fooServiceProvider = mock(ServiceProvider.class);
    final List<ServiceDefinition> fooServices = new ArrayList<>();
    fooServices.add(new ServiceDefinition(FooService.class, fooService));
    when(fooServiceProvider.providedServices()).thenReturn(fooServices);
    return new Pair<>(fooServiceClassLoader, fooServiceProvider);
}
Also used : ServiceProvider(org.mule.runtime.api.service.ServiceProvider) ArrayList(java.util.ArrayList) ServiceDefinition(org.mule.runtime.api.service.ServiceDefinition) Pair(org.mule.runtime.api.util.Pair)

Aggregations

ServiceProvider (org.mule.runtime.api.service.ServiceProvider)6 Pair (org.mule.runtime.api.util.Pair)6 ArtifactClassLoader (org.mule.runtime.module.artifact.api.classloader.ArtifactClassLoader)4 ArrayList (java.util.ArrayList)3 LinkedList (java.util.LinkedList)3 ServiceDefinition (org.mule.runtime.api.service.ServiceDefinition)3 Collection (java.util.Collection)1 Comparator.comparing (java.util.Comparator.comparing)1 HashSet (java.util.HashSet)1 LinkedHashMap (java.util.LinkedHashMap)1 List (java.util.List)1 Map (java.util.Map)1 Set (java.util.Set)1 Collectors.toList (java.util.stream.Collectors.toList)1 Test (org.junit.Test)1 MuleRuntimeException (org.mule.runtime.api.exception.MuleRuntimeException)1 Service (org.mule.runtime.api.service.Service)1 Preconditions.checkArgument (org.mule.runtime.api.util.Preconditions.checkArgument)1 ClassUtils.withContextClassLoader (org.mule.runtime.core.api.util.ClassUtils.withContextClassLoader)1 ServiceResolutionError (org.mule.runtime.module.service.api.discoverer.ServiceResolutionError)1