### Question:
CtxController { @RequestMapping("/") @ResponseBody public String index() { final StringBuilder sb = new StringBuilder("<html><body>"); sb.append(INTRO); String[] beanNames = ctx.getBeanDefinitionNames(); Arrays.sort(beanNames); for (String beanName : beanNames) { sb.append("</br>").append(beanName); } sb.append("</body></htm>"); return sb.toString(); } @Autowired  CtxController(ApplicationContext ctx); @RequestMapping("/") @ResponseBody String index(); @RequestMapping("/home") String home(ModelMap model);  }### Answer:
@Test public void textIndex() { String result = ctxController.index(); assertNotNull(result); assertTrue(result.contains(CtxController.INTRO)); }