vendredi 29 juillet 2016

ArrayList

This test give me all status in Boolean value True or False from API.

List<Boolean> allStatus = event.getResponse().getBody().jsonPath().getList("enabled");

There is no specific idea how many status will be or there is no fix size.It can be 20 or 1.

To check this assertion, I was writing for loop and check each value.

assertNotNull(allStatus);
for (Boolean status : allStatus) {
    assertEquals("FAILED Disable event status ", false, status);
}

I am trying to know what is better way to handle such scenario ?

Aucun commentaire:

Enregistrer un commentaire