I want to extract json object with restassured, and response is generic like:
@Data
public class ExtractBase<T> {
private Class<T> result; // here I can expect different classes
private String targetUrl;
private Boolean success;
private String error;
private Boolean unAuthorizedRequest;
private Boolean __abp;
}
and I want extract it and get result each time with different class:
.extract().body().as(ExtractBase.class).getResult(); // and here I want to have possibility to choose class which should be exctracted depends on my request
I have tried to use TypeToken but with no result :(
any tips for extracting generic classes from JSON responses?