My test automation scripts have setup() and tearDown() methods. In my setup(), I have few pre-requisites specified which will require by rest of the tests.
Now, in my setup() method I want to specify a function, which will fail the build if condition is not meeting.
E.g.
try {
// To do
} catch (Exception e) {
failJenkinsBuild();
}
I have gone through couple of solution but none specifies how to do it in Java?