Skip to content

Commit

Permalink
#239 Injector should not be set in case of testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Igor Polevoy committed Sep 23, 2015
1 parent 259f26c commit 2db7c99
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -129,11 +129,11 @@ private void initAppConfig(String configClassName, AppContext context, boolean f
try {
Class c = Class.forName(configClassName);
appConfig = (AppConfig) c.newInstance();
appConfig.init(context);

if(appConfig instanceof Bootstrap){
appBootstrap = (Bootstrap) appConfig;
Injector injector = appBootstrap.getInjector();
if(!Configuration.isTesting() ){
Injector injector = appBootstrap.getInjector();
if(Context.getControllerRegistry().getInjector() != null && injector != null){
throw new InitException("Either use setInjector() or getInjector(), but not both...");
}
Expand Down

0 comments on commit 2db7c99

Please sign in to comment.