1. You, This Course and Us
2. Example 1 : The @Test Annotation : Writing a test 3. Example 2: The Anatomy of a Test Method 4. Example 3: Assertions DOWNLOADS
5. Example 4: assertThat and Matchers 6. Example 5: Types of Matchers 7. Example 6: Using Matchers for Debugging 8. Example 7: Implementing a Custom Matcher Downloads
9. Example 8: Checking Preconditions with Assumptions Downloads
10. Example 9: Using Fixtures for Setup and Cleanup Downloads
11. Example 10: The @RunWith Annotation 12. Example 11: Aggregating tests in a Suite 13. Example 12: Parameterized Tests 14. Example 13: Running Subsets of Tests 15. Example 14: Theories Downloads
16. Example 15: External Resource Rules 17. Example 16: The Temporary Folder Rule 18. Example 17: Error Collector Rule 19. Example 18: Verifier Rule 20. Example 19: Test Watcher Rule 21. Example 20: TestName Rule 22. Example 21: ExpectedException Rule 23. Example 22: Timeout Rule 24. Example 23: Class Rule Downloads
25. Example 24: Creating Mock Objects and Verifying Interactions 26. Example 25: Stubbing Objects for Expected Results Downloads
What will I learn?
- Test functionality of Java applications using JUnit
- Write test cases using Assertions and Matchers
- Create mock objects to test interdependent classes
- Run multiple test classes under different conditions
About the course
JUnit is one of a family of unit testing frameworks all built with the same philosophy. To abstract the programmer away from the mechanics of running tests. You concentrate on testing the functionality of the application, and the logistics of running, monitoring and displaying results is taken care of by the framework.
In this course, we’ll be writing simple tests using all the different features of JUnit tests. Using 25 solved examples, you'll get a complete overview of the JUnit framework and all the functionality within.
- The fundamental component of any Junit test
- Write complicated tests in a very readable way. Implement your own custom matchers
- Check for preconditions and external dependencies
- Setup and Cleanup for your tests
- Understand what goes on under the hood in JUnit. Use different runners to run multiple test classes with different conditions and parameters
- Understand the concept of mock objects and use the Mockito framework to run tests on interdependent classes.
Who should take the course?
- Yep! Software Engineers who are looking to learn how to test Java applications
- Yep! Students learning Java who want to get familiar with testing
Pre-requisites & Requirements
- Experience in Java programming and familiarity with using Java frameworks