Skip to content

Commit f9f8f2d

Browse files
committed
Polishing
1 parent 43f8d9e commit f9f8f2d

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

spring-context/src/test/java/org/springframework/aop/aspectj/DeclarationOrderIndependenceTests.java

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ class DeclarationOrderIndependenceTests {
4444
@BeforeEach
4545
void setup() {
4646
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);
4949
}
5050

5151
@AfterEach
@@ -55,35 +55,33 @@ void tearDown() {
5555

5656

5757
@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);
6160
}
6261

6362
@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);
6765
}
6866

6967
@Test
70-
void testBeforeAdviceFiringOk() {
68+
void beforeAdviceFiringOk() {
7169
AspectCollaborator collab = new AspectCollaborator();
7270
this.aspect.setCollaborator(collab);
7371
this.target.doSomething();
7472
assertThat(collab.beforeFired).as("before advice fired").isTrue();
7573
}
7674

7775
@Test
78-
void testAroundAdviceFiringOk() {
76+
void aroundAdviceFiringOk() {
7977
AspectCollaborator collab = new AspectCollaborator();
8078
this.aspect.setCollaborator(collab);
8179
this.target.getX();
8280
assertThat(collab.aroundFired).as("around advice fired").isTrue();
8381
}
8482

8583
@Test
86-
void testAfterReturningFiringOk() {
84+
void afterReturningFiringOk() {
8785
AspectCollaborator collab = new AspectCollaborator();
8886
this.aspect.setCollaborator(collab);
8987
this.target.getX();

0 commit comments

Comments
 (0)