I am having a little issue.
When I use JSON path to extract a value from a DTO like so:
public String recipientEmail() {
String email = validatableResponse.extract().jsonPath().get("email[0]").toString();
return email;
}
If that DTO contains a value like:
email: "test@gmail.com"
It works fine and outputs this value. However, if the value is null
like so:
email: null
Then it gives me a NullPointerException
. How can I fix this and be able to retrieve the null
?
Thanks.