@Test public void discover_shouldCorrectlyInstantiateValidComponentRegistrars() { when(retriever.retrieve(context)) .thenReturn(Arrays.asList(TestRegistrar1.class.getName(), TestRegistrar2.class.getName())); List<ComponentRegistrar> result = discovery.discover(); assertThat(result).hasSize(2); ComponentRegistrar registrar; registrar = result.get(0); assertThat(registrar).isInstanceOf(TestRegistrar1.class); registrar = result.get(1); assertThat(registrar).isInstanceOf(TestRegistrar2.class); }
public List<ComponentRegistrar> discover() { return instantiate(retriever.retrieve(context)); }
ComponentDiscovery { public List<ComponentRegistrar> discover() { return instantiate(retriever.retrieve(context)); } }
ComponentDiscovery { public List<ComponentRegistrar> discover() { return instantiate(retriever.retrieve(context)); } @VisibleForTesting  ComponentDiscovery(T context, RegistrarNameRetriever<T> retriever); }
ComponentDiscovery { public List<ComponentRegistrar> discover() { return instantiate(retriever.retrieve(context)); } @VisibleForTesting  ComponentDiscovery(T context, RegistrarNameRetriever<T> retriever); static ComponentDiscovery<Context> forContext(
      Context context, Class<? extends Service> discoveryService); List<ComponentRegistrar> discover(); }
ComponentDiscovery { public List<ComponentRegistrar> discover() { return instantiate(retriever.retrieve(context)); } @VisibleForTesting  ComponentDiscovery(T context, RegistrarNameRetriever<T> retriever); static ComponentDiscovery<Context> forContext(
      Context context, Class<? extends Service> discoveryService); List<ComponentRegistrar> discover();  }