mercredi 3 février 2021

How to simply and explicitly fail a test case in JUnit with no extra assertions?

In my Java / RestAssured / TestNG framework, I want to write an assertion with the following structure

if(responseString.equals("Good Response!")) {
  // perform additional assertions here
} else if(responseString.equals("Bad Response!")) {
  // just fail the test case right here and now
}

What is the best way to go about simply failing the test case without asserting anything else?

Aucun commentaire:

Enregistrer un commentaire