@@ -44,8 +44,8 @@ class DeclarationOrderIndependenceTests {
44
44
@ BeforeEach
45
45
void setup () {
46
46
this .ctx = new ClassPathXmlApplicationContext (getClass ().getSimpleName () + ".xml" , getClass ());
47
- aspect = ( TopsyTurvyAspect ) ctx .getBean ("topsyTurvyAspect" );
48
- target = ( TopsyTurvyTarget ) ctx .getBean ("topsyTurvyTarget" );
47
+ aspect = ctx .getBean (TopsyTurvyAspect . class );
48
+ target = ctx .getBean (TopsyTurvyTarget . class );
49
49
}
50
50
51
51
@ AfterEach
@@ -55,35 +55,33 @@ void tearDown() {
55
55
56
56
57
57
@ Test
58
- void testTargetIsSerializable () {
59
- boolean condition = this .target instanceof Serializable ;
60
- assertThat (condition ).as ("target bean is serializable" ).isTrue ();
58
+ void targetIsSerializable () {
59
+ assertThat (this .target ).isInstanceOf (Serializable .class );
61
60
}
62
61
63
62
@ Test
64
- void testTargetIsBeanNameAware () {
65
- boolean condition = this .target instanceof BeanNameAware ;
66
- assertThat (condition ).as ("target bean is bean name aware" ).isTrue ();
63
+ void targetIsBeanNameAware () {
64
+ assertThat (this .target ).isInstanceOf (BeanNameAware .class );
67
65
}
68
66
69
67
@ Test
70
- void testBeforeAdviceFiringOk () {
68
+ void beforeAdviceFiringOk () {
71
69
AspectCollaborator collab = new AspectCollaborator ();
72
70
this .aspect .setCollaborator (collab );
73
71
this .target .doSomething ();
74
72
assertThat (collab .beforeFired ).as ("before advice fired" ).isTrue ();
75
73
}
76
74
77
75
@ Test
78
- void testAroundAdviceFiringOk () {
76
+ void aroundAdviceFiringOk () {
79
77
AspectCollaborator collab = new AspectCollaborator ();
80
78
this .aspect .setCollaborator (collab );
81
79
this .target .getX ();
82
80
assertThat (collab .aroundFired ).as ("around advice fired" ).isTrue ();
83
81
}
84
82
85
83
@ Test
86
- void testAfterReturningFiringOk () {
84
+ void afterReturningFiringOk () {
87
85
AspectCollaborator collab = new AspectCollaborator ();
88
86
this .aspect .setCollaborator (collab );
89
87
this .target .getX ();
0 commit comments