@Test void providesScopeAwareAggregatesFromModuleConfiguration() { when(configuration.findModules(AggregateConfiguration.class)).thenCallRealMethod(); when(configuration.getModules()) .thenReturn(singletonList(new WrappingModuleConfiguration(aggregateConfiguration))); when(aggregateConfiguration.repository()).thenReturn(aggregateRepository); List<ScopeAware> components = scopeAwareProvider.provideScopeAwareStream(anyScopeDescriptor()) .collect(toList()); assertEquals(singletonList(aggregateRepository), components); }
@Override public Stream<ScopeAware> provideScopeAwareStream(ScopeDescriptor scopeDescriptor) { if (scopeAwareComponents == null) { scopeAwareComponents = retrieveScopeAwareComponents(); } return scopeAwareComponents.stream(); }
ConfigurationScopeAwareProvider implements ScopeAwareProvider { @Override public Stream<ScopeAware> provideScopeAwareStream(ScopeDescriptor scopeDescriptor) { if (scopeAwareComponents == null) { scopeAwareComponents = retrieveScopeAwareComponents(); } return scopeAwareComponents.stream(); } }
ConfigurationScopeAwareProvider implements ScopeAwareProvider { @Override public Stream<ScopeAware> provideScopeAwareStream(ScopeDescriptor scopeDescriptor) { if (scopeAwareComponents == null) { scopeAwareComponents = retrieveScopeAwareComponents(); } return scopeAwareComponents.stream(); } ConfigurationScopeAwareProvider(Configuration configuration); }
ConfigurationScopeAwareProvider implements ScopeAwareProvider { @Override public Stream<ScopeAware> provideScopeAwareStream(ScopeDescriptor scopeDescriptor) { if (scopeAwareComponents == null) { scopeAwareComponents = retrieveScopeAwareComponents(); } return scopeAwareComponents.stream(); } ConfigurationScopeAwareProvider(Configuration configuration); @Override Stream<ScopeAware> provideScopeAwareStream(ScopeDescriptor scopeDescriptor); }
ConfigurationScopeAwareProvider implements ScopeAwareProvider { @Override public Stream<ScopeAware> provideScopeAwareStream(ScopeDescriptor scopeDescriptor) { if (scopeAwareComponents == null) { scopeAwareComponents = retrieveScopeAwareComponents(); } return scopeAwareComponents.stream(); } ConfigurationScopeAwareProvider(Configuration configuration); @Override Stream<ScopeAware> provideScopeAwareStream(ScopeDescriptor scopeDescriptor);  }