I have a map where i have stored expected values
private static final Map<String, List<String>> time = new HashMap<>();
Now i want to validate my expected values against Json response so i found below function in rest assured but here i need to pass each value separately in Matchers.hasitems
.then()
.statusCode(200)
.body(("findAll { it }.collect { it.values.time }"),Matchers.hasItems(time.get("in").get(0),time.get("in").get(1))
Is there a way I can pass the whole map in Matchers.hasitems
and it validates all the expected values in map . something like below?
.then()
.statusCode(200)
.body(("findAll { it }.collect { it.values.time }"),Matchers.hasItems("how can i pass map here")