-
Unit Testing Foundations
8 Lessons-
StartSection Introduction
-
StartWhat is Unit Testing?
-
StartWhat is JUnit?
-
PreviewIntroducing a Simple Unit Test in JUnit
-
PreviewStructure of a Unit Test (Arrange-Act-Assert and Given/When/Then)
-
StartConventions for Writing Unit Tests
-
StartCharacteristics of Proper Unit Tests
-
StartWhat are Assertions?
-
-
Creating a Java Project which uses JUnit
4 Lessons -
Writing and Running Unit Tests with JUnit and IntelliJ IDEA
13 Lessons-
StartSection Introduction
-
PreviewCreating a test method with the @Test annotation
-
StartRunning a unit test within the IDE and understanding test success
-
StartUnderstanding test failures with exceptions
-
StartFailing a unit tests explicitly with Assert.fail
-
StartUsing Assert.fail to check validation logic in a try/catch
-
StartAn introduction to the JUnit Assertions API
-
StartStructuring unit tests with Arrange/Act/Assert
-
StartUnderstanding execution of assertions and JUnit's fail-fast test failure mechanism
-
StartAdding descriptive comments to assertions and test failures to aid diagnostics
-
StartCoding a unit test following Arrange-Act-Assert
-
StartKeeping test setup DRY with @Before
-
StartUnderstanding test fixture instantiation
-
-
Unit Testing with Mock Objects and Mockito
12 Lessons-
StartSection introduction
-
PreviewWhat is Mockito and what are mock objects?
-
StartConfiguring Projects to Use Mockito
-
StartCreating a project which uses JUnit and Mockito
-
StartCoding a Layered Architecture - Presentation Layer
-
StartCoding a Layered Architecture - Business Layer
-
StartCoding a Layered Architecture - Persistence Layer
-
StartPutting the correct packages in place to respect the layering
-
StartWriting a test for the Login Controller in the presentation layer
-
PreviewUnderstanding the test fixture setup when writing mock object based unit tests
-
StartWriting a test for the Authentication Service in the business layer
-
StartThinking about design decisions when unit testing
-
-
Looking at the Hamcrest Assertions Library
25 Lessons-
StartSection Introduction
-
StartEvolving the Domain and Repository Classes
-
StartIgnoring Tests with @ignore
-
StartImplementing a Finder in the Repository
-
StartImplementing Business Logic in the Service
-
StartConfiguring Maven to use Java 8
-
StartEvolving the Repository Class
-
StartAdding a Parameter-driven Finder to the Service
-
StartRefactoring to Evolve a New Service
-
StartGenerating Test Methods in the IDE and Toggling Between Production and Test Code
-
StartIntroducing the JUnit Mockito Runner and @Mock
-
StartAnalyzing the Production Code to Determine How to Write the Arrange Section
-
StartUsing Mockito's @InjectMocks to Create the System Under Test with it's Dependenc
-
StartKeep Yourself Motivated by Checking the Happy Path Test Output
-
StartUsing the JUnit Assertions API to write the Assert Section
-
StartThinking About the Weaknesses of the JUnit Assertions API
-
StartThe Importance of Checking Your Work as you Go!
-
StartUpgrading a JUnit project to use the full Hamcrest version
-
StartReplacing JUnit assertions with Hamcrest assertions and using assertions with co
-
StartUnderstanding and Reading Hamcrest Test Failures
-
StartQuick thoughts on Hamcrest individual vs collection Assertions
-
StartDon't invoke unneeded production code in your test classes
-
StartUnderstanding Evaluation of Hamcrest Matchers
-
StartThinking about why we keep production code to a minimum in tests
-
StartCreating Complex Hamcrest Assertions with allOf and Property Matchers
-
