1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.springframework.context.annotation.aspectj;
18
19 import org.junit.Assert;
20 import org.junit.Test;
21
22 import org.springframework.beans.factory.aspectj.ShouldBeConfiguredBySpring;
23 import org.springframework.context.annotation.AnnotationConfigApplicationContext;
24 import org.springframework.context.annotation.Configuration;
25 import org.springframework.context.annotation.ImportResource;
26
27
28
29
30
31
32
33
34
35 public class AnnotationBeanConfigurerTests {
36
37 @Test
38 public void testInjection() {
39 AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(Config.class);
40 ShouldBeConfiguredBySpring myObject = new ShouldBeConfiguredBySpring();
41 Assert.assertEquals("Rod", myObject.getName());
42 }
43
44
45 @Configuration
46 @ImportResource("org/springframework/beans/factory/aspectj/beanConfigurerTests-beans.xml")
47 @EnableSpringConfigured
48 static class Config {
49 }
50
51 }