@Test public void shouldBindSpringBeans() { TestBean bean1 = prepareBean("bean1"); TestBean bean2 = prepareBean("bean2"); given(applicationContext.getBeanDefinitionNames()).willReturn(new String[]{ bean1.name(), bean2.name() }); Map<String, Object> shellContext = GroovyChange.createShellContext(applicationContext, out); assertEquals(shellContext.get(bean1.name()), bean1); assertEquals(shellContext.get(bean2.name()), bean2); }
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);  }