0

I have an object where I annotated few variables with @JsonIgnore. But I wanted to check the values of those fields in test cases but I don't want it to be included in the response. For example,

class MyObject{

    private variable1;

    @JsonIgnore
    private variable2;

    @JsonIgnore
    private variable3;

    @JsonIgnore
    private variable4;
}

Here, I want to ignore variable2, variable3 and variable4 in response json when the request came from actual user(i.e from browser). But I want to include those values when I am requesting through test cases. Please point me in the right direction.

Raghavendra
  • 3,876
  • 4
  • 22
  • 41

0 Answers0