Unit Testing: Assertions & Assumptions in JUnit

placeholder

Assertions a collection of utility methods in in JUnit help assert the pass or fail status of test cases. The focus of this course is on assertions that allow you to set the conditions for the success and failure of test cases and assumptions to control the flow of execution in a test case. Begin with simple assert methods to compare the actual values of fields or return values of methods with their expected values. Then use assertions that ensure your apps performance by failing a test if it takes too long to run followed by assert methods that check an exception is thrown when invalid data is passed to a method. Next use assumptions that check for conditions before executing a code block – effectively serving as control structures. When youre done youll have a working knowledge of using assertions in JUnit.