@Test public void test_getClasses_from_global_components() throws Exception { when(globalClassesProvider.getClasses()) .thenReturn(ImmutableSet.of(AdditionalResource.class)); JaxRsApplication app = new JaxRsApplication(ImmutableSet.of(localComponent), ImmutableSet.of(globalComponent), ImmutableSet.of(localClassesProvider), ImmutableSet.of(globalClassesProvider)); Set<Class<?>> additionalClasses = app.getClasses(); assertEquals(1, additionalClasses.size()); assertTrue(additionalClasses.contains(AdditionalResource.class)); }
@Override public Set<Class<?>> getClasses() { return Stream.concat(localClassesProviders.stream(), globalClassesProviders.stream()) .flatMap(component -> component.getClasses().stream()) .collect(Collectors.toSet()); }
JaxRsApplication extends Application { @Override public Set<Class<?>> getClasses() { return Stream.concat(localClassesProviders.stream(), globalClassesProviders.stream()) .flatMap(component -> component.getClasses().stream()) .collect(Collectors.toSet()); } }
JaxRsApplication extends Application { @Override public Set<Class<?>> getClasses() { return Stream.concat(localClassesProviders.stream(), globalClassesProviders.stream()) .flatMap(component -> component.getClasses().stream()) .collect(Collectors.toSet()); } JaxRsApplication(Set<JaxRsComponent> localComponents, Set<JaxRsComponent> globalComponents,
      Set<JaxRsClassesProvider> localClassesProviders, Set<JaxRsClassesProvider> globalClassesProviders); }
JaxRsApplication extends Application { @Override public Set<Class<?>> getClasses() { return Stream.concat(localClassesProviders.stream(), globalClassesProviders.stream()) .flatMap(component -> component.getClasses().stream()) .collect(Collectors.toSet()); } JaxRsApplication(Set<JaxRsComponent> localComponents, Set<JaxRsComponent> globalComponents,
      Set<JaxRsClassesProvider> localClassesProviders, Set<JaxRsClassesProvider> globalClassesProviders); @Override Set<Object> getSingletons(); @Override Set<Class<?>> getClasses(); @Override Map<String, Object> getProperties(); }
JaxRsApplication extends Application { @Override public Set<Class<?>> getClasses() { return Stream.concat(localClassesProviders.stream(), globalClassesProviders.stream()) .flatMap(component -> component.getClasses().stream()) .collect(Collectors.toSet()); } JaxRsApplication(Set<JaxRsComponent> localComponents, Set<JaxRsComponent> globalComponents,
      Set<JaxRsClassesProvider> localClassesProviders, Set<JaxRsClassesProvider> globalClassesProviders); @Override Set<Object> getSingletons(); @Override Set<Class<?>> getClasses(); @Override Map<String, Object> getProperties();  }