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