@Test void testDependencyInjection() { Service2 service2 = this.serviceLocator.getService(Service2.class); assertThat(service2.checkServices(), is(true)); }
public DependencyInjection(Extension... extensions) { this.internalServiceLocator = new InternalServiceLocator(this::onRegister); this.extensions = new HashSet<>(Arrays.asList(extensions)); this.extensions.forEach(ext -> ext.postConstruct(this)); }
DependencyInjection { public DependencyInjection(Extension... extensions) { this.internalServiceLocator = new InternalServiceLocator(this::onRegister); this.extensions = new HashSet<>(Arrays.asList(extensions)); this.extensions.forEach(ext -> ext.postConstruct(this)); } }
DependencyInjection { public DependencyInjection(Extension... extensions) { this.internalServiceLocator = new InternalServiceLocator(this::onRegister); this.extensions = new HashSet<>(Arrays.asList(extensions)); this.extensions.forEach(ext -> ext.postConstruct(this)); } DependencyInjection(Extension... extensions); }
DependencyInjection { public DependencyInjection(Extension... extensions) { this.internalServiceLocator = new InternalServiceLocator(this::onRegister); this.extensions = new HashSet<>(Arrays.asList(extensions)); this.extensions.forEach(ext -> ext.postConstruct(this)); } DependencyInjection(Extension... extensions); void loadServices(); Configuration getConfiguration(); ServiceLocator getServiceLocator(); }
DependencyInjection { public DependencyInjection(Extension... extensions) { this.internalServiceLocator = new InternalServiceLocator(this::onRegister); this.extensions = new HashSet<>(Arrays.asList(extensions)); this.extensions.forEach(ext -> ext.postConstruct(this)); } DependencyInjection(Extension... extensions); void loadServices(); Configuration getConfiguration(); ServiceLocator getServiceLocator();  }