Curriculum
- 1 Section
- 4 Lessons
- 2 Days
Expand all sectionsCollapse all sections
- TopicsJava Testing with JUnit 5 Overview Agenda Conventions4
- 1.1Session 1: Unit Testing with JUnit 5 Objectives Overview Testing Overview Overview JUnit 5 New in JUnit 5? Library Components Library Components – Illustrated a Test – First Example Tests in the IDE Tests in Other Environments Conventions and Organizing Tests 1.1 – Getting Started with JUnit Tests and Assertions Test Methods All about Expectations Point Assertions Messages Messages – Useful or Not? Messages – a Practical Approach 1.2 – Tests and Assertions Test Fixtures and Lifecycle Fixtures – @BeforeEach and @AfterEach Fixtures – Example and @AfterAll of Execution – Full Test Lifecycle Instance Creation Lifecycle 1.3 – Test Fixtures and Lifecycle
- 1.2Session 2: Writing and Running Tests Objectives Aside – Java 8 New Features – and Optionals and Static Interface Methods Interface – Defined a Method Down to its Essence Expression as Functional Interface Interfaces and Lambdas Functional Interfaces in JUnit – Executable in JUnit – ThrowingSupplier in JUnit – ThrowingConsumer Additional Testing Needs for Exceptions for Exceptions – Example Timeouts Timeouts – Example Groups Groups – Example 2.1 – Exceptions, Assertion Groups, and Timeouts Running Tests Library Components – Revisited of Ways to Run Tests Support – Eclipse Support – IntelliJ IDEA for Maven Project – mvn test maven-surefire-plugin Platform Console Launcher the Console Launcher Tests Programmatically Which Tests Get Run Discovery and Selection 2.2 – Running Tests Names and Filtering Tests with Tags Tags at Test Run Expressions Parameters Configuration Parameters Tests Test Class Results – Illustrated Test Class Results – Illustrated Tests – Example for Nested Test Classes 2.3 – Test Reporting and Filtering Advanced Capabilities Composed Annotations Good OO in Test Classes with Test Classes All about Removing Redundancy – Overview and Using Extensions and Insertion Points Lifecycle with Extension Callbacks Test Execution [new in 5.1.0] Tests vs Assumptions Conditions at Runtime Tests Tests – Details 2.4 – Advanced Capabilities JUnit 4 Migration Do Nothing Case with Old Software JUnit 4 Tests to Jupiter API in Migration – API Changes in Migration – Runners and Rules 4 Test Suites 4 Test Suites on the JUnit Platform 4 Test Suites – Example Best Practices Are Real Code to Test void and Private Methods Thorough Small Tests vs. Fewer Large Tests to Break It and Broad Testing of Good Tests Testable Code Testable Code Anti-Patterns Reading
- 1.3Session 3: Testing with Mocks Objectives Overview of Mock Objects as Collaborators Mockito Creating and Using Mocks Steps in Mocking Mockito Class Evolution in Mock Creation Creation with JUnit 5 Method Calls Much Stubbing? – Business Object and Collaborator – Setting up the Mock and Testing 3.1 – Using Mock Objects Additional Capabilities Matchers Argument Matchers Mocking with Spies the Unmockable Injection of Mocks Injection of Mocks 3.2 – Additional Capabilities [Optional HW]
- 1.4Session 4: Testing Enterprise Components Objectives Overview of Testing of Testing Issues Involved and the HAS-A Relationship in the Java EE Container Options vs. In-Container Testing vs. In-Container Testing vs. In-Container Testing Necessarily Competitors Testing the Persistence Layer vs. Implementation Really Need a Database vs. In-Container Testing Specific to Database Testing 4.1 – Testing the Persistence Layerr Testing It Looks Like Configuration and Deployment Testing Services Issues, Different Layer It Worth It? Testing Web Components Saved the Hardest for Last Issues, Easier Answer Testing Isn’t Enough vs. Automated Testing as Much as Possible the Web Browser Recap of What We’ve Done of What We’ve Done
Session 2: Writing and Running Tests Objectives Aside – Java 8 New Features – and Optionals and Static Interface Methods Interface – Defined a Method Down to its Essence Expression as Functional Interface Interfaces and Lambdas Functional Interfaces in JUnit – Executable in JUnit – ThrowingSupplier<T> in JUnit – ThrowingConsumer<T> Additional Testing Needs for Exceptions for Exceptions – Example Timeouts Timeouts – Example Groups Groups – Example 2.1 – Exceptions, Assertion Groups, and Timeouts Running Tests Library Components – Revisited of Ways to Run Tests Support – Eclipse Support – IntelliJ IDEA for Maven Project – mvn test maven-surefire-plugin Platform Console Launcher the Console Launcher Tests Programmatically Which Tests Get Run Discovery and Selection 2.2 – Running Tests Names and Filtering Tests with Tags Tags at Test Run Expressions Parameters Configuration Parameters Tests Test Class Results – Illustrated Test Class Results – Illustrated Tests – Example for Nested Test Classes 2.3 – Test Reporting and Filtering Advanced Capabilities Composed Annotations Good OO in Test Classes with Test Classes All about Removing Redundancy – Overview and Using Extensions and Insertion Points Lifecycle with Extension Callbacks Test Execution [new in 5.1.0] Tests vs Assumptions Conditions at Runtime Tests Tests – Details 2.4 – Advanced Capabilities JUnit 4 Migration Do Nothing Case with Old Software JUnit 4 Tests to Jupiter API in Migration – API Changes in Migration – Runners and Rules 4 Test Suites 4 Test Suites on the JUnit Platform 4 Test Suites – Example Best Practices Are Real Code to Test void and Private Methods Thorough Small Tests vs. Fewer Large Tests to Break It and Broad Testing of Good Tests Testable Code Testable Code Anti-Patterns Reading
Next