@Test public void injection() { try (AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(Config.class)) { ShouldBeConfiguredBySpring myObject = new ShouldBeConfiguredBySpring(); assertEquals("Rod", myObject.getName()); } }
@Test public void injection() { try (ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext( "org/springframework/beans/factory/aspectj/beanConfigurerTests.xml")) { ShouldBeConfiguredBySpring myObject = new ShouldBeConfiguredBySpring(); assertEquals("Rod", myObject.getName()); } }