I have three classes as follows :
public class Foo {
private Long fooId;
private String fooName;
private List<Bar> bars;
}
public class Bar {
private Long barId;
private String barName;
private Foo foo;
}
public class FooBar {
List<Foo> foo;
List<Bar> bars;
}
FooBar is what I am getting in the response. I am little bit confused about how to compare, especially Foo using hasItem() of hamcrest.Matchers.* or is there any better way. how we can compare this in Junit5?