Come posso verificare con rest-assured (2.4.0) se la risposta json è una lista vuota?Asserire che il corpo della risposta è una lista vuota con il resto sicuro
Data la risposta []
(con intestazione content-type=application/json
) Ho provato:
.body(Matchers.emptyArray()) // expected: an empty array, actual: []
.body("/", Matchers.emptyArray()) // invalid expression/
.body(".", Matchers.emptyArray()) // invalid expression .
Se potrebbe aiutare, questo passa il matcher: 'matrice Object [] = new Object [0]; ' ' new MatcherAssert(). AssertThat (array, Matchers.emptyArray()); ' – romfret