@Test public void shouldNotBindSpringBeansUnderAlias() { TestBean bean = prepareBean("bean"); TestBean beanWithAlias = prepareBean("beanWithAlias"); given(applicationContext.getBeanDefinitionNames()).willReturn(new String[]{ bean.name(), beanWithAlias.name() }); given(applicationContext.getAliases(beanWithAlias.name())).willReturn(new String[] {"beanAlias" }); Map<String, Object> shellContext = GroovyChange.createShellContext(applicationContext, out); assertFalse(shellContext.containsKey("beanWithAlias")); assertTrue(shellContext.containsKey("bean")); assertTrue(shellContext.containsKey("beanAlias")); }
public static Map<String, Object> createShellContext(ApplicationContext applicationContext, Log4JPrintStream output) { final Map<String, Object> shellContext = new HashMap<>(); shellContext.put("ctx", applicationContext); shellContext.put("spring", applicationContext); bindSpringBeans(applicationContext, shellContext); shellContext.put("out", output); return shellContext; }
GroovyChange extends Change { public static Map<String, Object> createShellContext(ApplicationContext applicationContext, Log4JPrintStream output) { final Map<String, Object> shellContext = new HashMap<>(); shellContext.put("ctx", applicationContext); shellContext.put("spring", applicationContext); bindSpringBeans(applicationContext, shellContext); shellContext.put("out", output); return shellContext; } }
GroovyChange extends Change { public static Map<String, Object> createShellContext(ApplicationContext applicationContext, Log4JPrintStream output) { final Map<String, Object> shellContext = new HashMap<>(); shellContext.put("ctx", applicationContext); shellContext.put("spring", applicationContext); bindSpringBeans(applicationContext, shellContext); shellContext.put("out", output); return shellContext; } GroovyChange(ChangeBasic changeBasic, ChangeDependency changeDependency); }
GroovyChange extends Change { public static Map<String, Object> createShellContext(ApplicationContext applicationContext, Log4JPrintStream output) { final Map<String, Object> shellContext = new HashMap<>(); shellContext.put("ctx", applicationContext); shellContext.put("spring", applicationContext); bindSpringBeans(applicationContext, shellContext); shellContext.put("out", output); return shellContext; } GroovyChange(ChangeBasic changeBasic, ChangeDependency changeDependency); static Map<String, Object> createShellContext(ApplicationContext applicationContext,
                                                         Log4JPrintStream output); }
GroovyChange extends Change { public static Map<String, Object> createShellContext(ApplicationContext applicationContext, Log4JPrintStream output) { final Map<String, Object> shellContext = new HashMap<>(); shellContext.put("ctx", applicationContext); shellContext.put("spring", applicationContext); bindSpringBeans(applicationContext, shellContext); shellContext.put("out", output); return shellContext; } GroovyChange(ChangeBasic changeBasic, ChangeDependency changeDependency); static Map<String, Object> createShellContext(ApplicationContext applicationContext,
                                                         Log4JPrintStream output);  }