File tree Expand file tree Collapse file tree 2 files changed +11
-7
lines changed
main/java/io/qameta/allure/assertj
test/java/io/qameta/allure/assertj Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Original file line number Diff line number Diff line change 1818
1919import static io .qameta .allure .util .ResultsUtils .getStatus ;
2020import static io .qameta .allure .util .ResultsUtils .getStatusDetails ;
21+ import static java .util .Objects .nonNull ;
2122
2223/**
2324 * @author charlie (Dmitry Baev).
25+ * @author sskorol (Sergey Korol).
2426 */
2527@ SuppressWarnings ("all" )
2628@ Aspect
@@ -73,12 +75,9 @@ public static AllureLifecycle getLifecycle() {
7375
7476 private static String arrayToString (final Object ... array ) {
7577 return Stream .of (array )
76- .map (object -> {
77- if (object .getClass ().isArray ()) {
78- return arrayToString ((Object []) object );
79- }
80- return Objects .toString (object );
81- })
82- .collect (Collectors .joining (" " ));
78+ .map (object -> nonNull (object ) && object .getClass ().isArray ()
79+ ? arrayToString ((Object []) object )
80+ : Objects .toString (object ))
81+ .collect (Collectors .joining (" " ));
8382 }
8483}
Original file line number Diff line number Diff line change @@ -47,4 +47,9 @@ public void shouldCreateStepsForAsserts() throws Exception {
4747 .extracting (StepResult ::getName )
4848 .containsExactly ("assertThat 'Data'" , "hasSize '4'" );
4949 }
50+
51+ @ Test
52+ public void shouldHandleNullableObject () {
53+ assertThat ((Object ) null ).as ("Nullable object" ).isNull ();
54+ }
5055}
You can’t perform that action at this time.
0 commit comments