Skip to content

Commit ac545fb

Browse files
committed
Review: Simplify test assertion by using ArchUnit infrastructure and Guava AssertJ
Issue: #187 Signed-off-by: Peter Gafert <[email protected]>
1 parent 7507180 commit ac545fb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: archunit/src/test/java/com/tngtech/archunit/core/domain/JavaClassTest.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -83,15 +83,15 @@ public void finds_array_type() {
8383
JavaMethod method = importClassWithContext(IsArrayTestClass.class).getMethod("anArray");
8484

8585
assertThat(method.getRawReturnType().isArray()).isTrue();
86-
assertThat(method.getRawReturnType().tryGetComponentType().get().getName()).isEqualTo("java.lang.Object");
86+
assertThat(method.getRawReturnType().tryGetComponentType().get()).matches(Object.class);
8787
}
8888

8989
@Test
9090
public void finds_non_array_type() {
9191
JavaMethod method = importClassWithContext(IsArrayTestClass.class).getMethod("notAnArray");
9292

9393
assertThat(method.getRawReturnType().isArray()).isFalse();
94-
assertThat(method.getRawReturnType().tryGetComponentType().isPresent()).isFalse();
94+
assertThat(method.getRawReturnType().tryGetComponentType()).isAbsent();
9595
}
9696

9797
@Test
@@ -1152,4 +1152,4 @@ private class NestedNamedInnerClass {
11521152
}
11531153
}
11541154
}
1155-
}
1155+
}

0 commit comments

Comments
 (0)