@Test void shouldThrowForInvalidPackage() { InjectorException ex = assertThrows(InjectorException.class, () -> injector.getSingleton(InvalidClass.class)); assertThat(ex.getMessage(), containsString("outside of the allowed packages")); }
@Override public <T> T getSingleton(Class<T> clazz) { return resolve(SINGLETON, clazz); }
InjectorImpl implements Injector { @Override public <T> T getSingleton(Class<T> clazz) { return resolve(SINGLETON, clazz); } }
InjectorImpl implements Injector { @Override public <T> T getSingleton(Class<T> clazz) { return resolve(SINGLETON, clazz); } protected  InjectorImpl(InjectorConfig config); }
InjectorImpl implements Injector { @Override public <T> T getSingleton(Class<T> clazz) { return resolve(SINGLETON, clazz); } protected  InjectorImpl(InjectorConfig config); @Override void register(Class<? super T> clazz, T object); @Override void provide(Class<? extends Annotation> clazz, Object object); @Override T getSingleton(Class<T> clazz); @Override T newInstance(Class<T> clazz); @Override T getIfAvailable(Class<T> clazz); @Override T createIfHasDependencies(Class<T> clazz); @Override Collection<T> retrieveAllOfType(Class<T> clazz); @Override void registerProvider(Class<T> clazz, Provider<? extends T> provider); @Override void registerProvider(Class<T> clazz, Class<P> providerClass); InjectorConfig getConfig(); }
InjectorImpl implements Injector { @Override public <T> T getSingleton(Class<T> clazz) { return resolve(SINGLETON, clazz); } protected  InjectorImpl(InjectorConfig config); @Override void register(Class<? super T> clazz, T object); @Override void provide(Class<? extends Annotation> clazz, Object object); @Override T getSingleton(Class<T> clazz); @Override T newInstance(Class<T> clazz); @Override T getIfAvailable(Class<T> clazz); @Override T createIfHasDependencies(Class<T> clazz); @Override Collection<T> retrieveAllOfType(Class<T> clazz); @Override void registerProvider(Class<T> clazz, Provider<? extends T> provider); @Override void registerProvider(Class<T> clazz, Class<P> providerClass); InjectorConfig getConfig();  }