### Question:
AppConfig { public void showConnectionInfo() { System.out.println("url : " + url + ", username : " + username + ", password : " + password); } AppConfig(); @Bean DataSource dataSource(); void showConnectionInfo();  }### Answer:
@Test public void testImportResourceAnnotation() throws Exception { ApplicationContext context = new AnnotationConfigApplicationContext(AppConfig.class); AppConfig config = context.getBean(AppConfig.class); config.showConnectionInfo(); }