java - Differ behavior of a junit-test based on success or no success -
this question has answer here:
- junit conditional teardown 1 answer
i have unit-tests setup @before-method , cleaned @after-method. want @after-method different if test succeed if failed. how can this?
you need use boolean flag in @after method decide want in case of success or failure. can define flag ispassed
in test class, turn true if test case passed or turn false in case of failure. read variable in @after method , decide need do.
Comments
Post a Comment