Skip to content

Commit

Permalink
Review: Simplify test assertion by using ArchUnit infrastructure and …
Browse files Browse the repository at this point in the history
…Guava AssertJ

Issue: TNG#187
Signed-off-by: Peter Gafert <peter.gafert@tngtech.com>
  • Loading branch information
codecholeric committed Nov 3, 2019
1 parent 7507180 commit ac545fb
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,15 @@ public void finds_array_type() {
JavaMethod method = importClassWithContext(IsArrayTestClass.class).getMethod("anArray");

assertThat(method.getRawReturnType().isArray()).isTrue();
assertThat(method.getRawReturnType().tryGetComponentType().get().getName()).isEqualTo("java.lang.Object");
assertThat(method.getRawReturnType().tryGetComponentType().get()).matches(Object.class);
}

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

assertThat(method.getRawReturnType().isArray()).isFalse();
assertThat(method.getRawReturnType().tryGetComponentType().isPresent()).isFalse();
assertThat(method.getRawReturnType().tryGetComponentType()).isAbsent();
}

@Test
Expand Down Expand Up @@ -1152,4 +1152,4 @@ private class NestedNamedInnerClass {
}
}
}
}
}

0 comments on commit ac545fb

Please sign in to comment.