Chapter
6Establishing Organization in JUnit Tests
Your JUnit learnings so far include:
- How to run JUnit and understand its results
- How to group related test methods within a test class
- How to group common test initialization into a @BeforeEach method
- A deep dive into JUnit assertions (the previous chapter)
Generally, you want at least one test class for each production class you develop. In this chapter, you’ll dig into the topic of test organization within a test class. You’ll learn about:
- The parts of a test
- Initializing and cleaning up using lifecycle methods
- Grouping related tests with nested classes
- The JUnit test execution lifecycle
- Avoiding dependency challenges by never ordering tests
- Executing multiple test cases for a single test using parameterized ...