@@ -13,21 +13,18 @@ public final class TestStepResult {
13
13
private final Duration duration ;
14
14
private final String message ;
15
15
private final TestStepResultStatus status ;
16
- private final String exceptionType ;
17
- private final String exceptionMessage ;
16
+ private final Exception exception ;
18
17
19
18
public TestStepResult (
20
19
Duration duration ,
21
20
String message ,
22
21
TestStepResultStatus status ,
23
- String exceptionType ,
24
- String exceptionMessage
22
+ Exception exception
25
23
) {
26
24
this .duration = requireNonNull (duration , "TestStepResult.duration cannot be null" );
27
25
this .message = message ;
28
26
this .status = requireNonNull (status , "TestStepResult.status cannot be null" );
29
- this .exceptionType = exceptionType ;
30
- this .exceptionMessage = exceptionMessage ;
27
+ this .exception = exception ;
31
28
}
32
29
33
30
public Duration getDuration () {
@@ -42,12 +39,8 @@ public TestStepResultStatus getStatus() {
42
39
return status ;
43
40
}
44
41
45
- public Optional <String > getExceptionType () {
46
- return Optional .ofNullable (exceptionType );
47
- }
48
-
49
- public Optional <String > getExceptionMessage () {
50
- return Optional .ofNullable (exceptionMessage );
42
+ public Optional <Exception > getException () {
43
+ return Optional .ofNullable (exception );
51
44
}
52
45
53
46
@ Override
@@ -59,8 +52,7 @@ public boolean equals(Object o) {
59
52
duration .equals (that .duration ) &&
60
53
Objects .equals (message , that .message ) &&
61
54
status .equals (that .status ) &&
62
- Objects .equals (exceptionType , that .exceptionType ) &&
63
- Objects .equals (exceptionMessage , that .exceptionMessage );
55
+ Objects .equals (exception , that .exception );
64
56
}
65
57
66
58
@ Override
@@ -69,8 +61,7 @@ public int hashCode() {
69
61
duration ,
70
62
message ,
71
63
status ,
72
- exceptionType ,
73
- exceptionMessage
64
+ exception
74
65
);
75
66
}
76
67
@@ -80,8 +71,7 @@ public String toString() {
80
71
"duration=" + duration +
81
72
", message=" + message +
82
73
", status=" + status +
83
- ", exceptionType=" + exceptionType +
84
- ", exceptionMessage=" + exceptionMessage +
74
+ ", exception=" + exception +
85
75
'}' ;
86
76
}
87
77
}
0 commit comments