下面列出了怎么用org.springframework.beans.factory.aspectj.ShouldBeConfiguredBySpring的API类实例代码及写法,或者点击链接到github查看源代码。
@Test
public void injection() {
try (AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(Config.class)) {
ShouldBeConfiguredBySpring myObject = new ShouldBeConfiguredBySpring();
assertEquals("Rod", myObject.getName());
}
}
@Test
public void injection() {
try (AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(Config.class)) {
ShouldBeConfiguredBySpring myObject = new ShouldBeConfiguredBySpring();
assertEquals("Rod", myObject.getName());
}
}
@Test
public void testInjection() {
AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(Config.class);
ShouldBeConfiguredBySpring myObject = new ShouldBeConfiguredBySpring();
Assert.assertEquals("Rod", myObject.getName());
}