Mastering Java & Spring Framework Essentials Bundle
4 Courses & 11 Hours
$24.99$132.00
You save 81%
What's Included
$33.00 Value
JUnit & Mockito Unit Testing for Java Developers
Matt Speake
61 Lessons (2h)
Lifetime
- Experience level required: Beginner
- Access 61 lectures & 2 hours of content 24/7
- Length of time users can access this course: Lifetime
Course Curriculum
61 Lessons (2h)
- Your First Program
- Unit Testing FoundationsOverview of the Course Structure1:34What is Unit Testing?2:45Introducing a Simple Unit Test in JUnit3:02Structure of a Unit Test5:08Conventions for Writing Unit Tests2:41Characteristics of Proper Unit Tests5:48
- Creating a Java Project which uses JUnit01 - Section Introduction0:49Creating a Java project which includes JUnit using the Maven Quickstart Archetype2:51Introducing a typical Java project structure (production vs test source trees)2:47Understanding the basic conventions for creating unit tests (package and naming conventions)3:4201 - Section Introduction0:36
- Writing and Running Unit Tests with JUnit and IntelliJ IDEASection Introduction0:52Creating a test method with the @Test annotation1:39Running a unit test within the IDE and understanding test success1:21Understanding test failures with exceptions2:21Failing a unit test explicitly with Assert.fail0:45Using Assert.fail to check validation logic in a try:catch2:23An introduction to the JUnit Assertions APIStructuring unit tests with Arrange:Act:Assert2:04Understanding execution of assertions and JUnit's fail-fast test failure mechanism3:28Adding descriptive comments to assertions and test failures to aid diagnostics0:48Coding a unit test following Arrange-Act-Assert1:12Keeping test setup DRY with @Before4:55Understanding test fixture instantiation2:14
- Unit Testing with Mock Objects and MockitoWhat is Mockito and what are Mock Objects?3:58Introduction to testing with mock objects4:56Configuring Projects to Use Mockito2:45Creating a project which uses JUnit and Mockito4:07Coding a Layered Architecture - Presentation Layer3:26Coding a Layered Architecture - Business Layer3:32Coding a Layered Architecture - Persistence Layer4:11Putting the correct packages in place to respect the layering2:44Writing a test for the Login Controller in the presentation layer9:48Understanding the test fixture setup when writing mock object based unit tests1:01Writing a test for the Authentication Service in the business layer3:57Thinking about design decisions when unit testing0:38
- Looking at the Hamcrest Assertions LibrarySection Introduction0:58Evolving the Domain and Repository Classes6:36Ignoring Tests with @ignore4:17Implementing a Finder in the Repository0:57Implementing Business Logic in the Service3:13Configuring Maven to use Java 82:32Evolving the Repository Class1:32Adding a Parameter-driven Finder to the Service1:34Refactoring to Evolve a New Service1:16Generating Test Methods in the IDE and Toggling Between Production and Test Code1:26Introducing the JUnit Mockito Runner and @Mock1:04Analyzing the Production Code to Determine How to Write the Arrange Section3:58Using Mockito's @InjectMocks to Create the System Under Test with it's Dependencies1:33Keep Yourself Motivated by Checking the Happy Path Test Output2:06Using the JUnit Assertions API to write the Assert Section5:17Thinking About the Weaknesses of the JUnit Assertions API1:59The Importance of Checking Your Work as you Go2:29Upgrading a JUnit project to use the full Hamcrest version3:11Replacing JUnit assertions with Hamcrest assertions and using assertions with collections2:12Understanding and Reading Hamcrest Test Failures2:46Quick thoughts on Hamcrest individual vs collection Assertions0:29Don't invoke unneeded production code in your test classes1:01Understanding Evaluation of Hamcrest Matchers1:17Thinking about why we keep production code to a minimum in tests1:19Creating Complex Hamcrest Assertions with allOf and Property Matchers4:32
JUnit & Mockito Unit Testing for Java Developers
MS
Matt SpeakeMatt Speake | Java Technologist | Online Instructor
4.4/5 Instructor Rating:
★ ★ ★ ★
★ ★
Matt Speake is a professional software engineer specializing in Java technologies. He has over 20 years of experience working everywhere from small startups to large global corporations and is the principal trainer at Zention in the UK. He specializes in teaching all things related to Java technology. He is a published instructor on Udemy, Skillshare, StackSkills, Packt, and O'Reilly and on the JavaEasily platform.
Description
Do you want to get hands-on demonstrations of JUnit and Mockito in action, want a simple no-fluff guide to how unit testing works, including getting an understanding of best practices along the way? This course packs all the good stuff that's been distilled down through the years - it's the best practice and gets you up and running with knowing the stuff the APIs don't tell you. This course covers writing tests with JUnit and mock objects-based unit tests with Mockito. You'll also learn how to harness the power of Hamcrest to do more powerful assertions.
4.7/5 average rating:
★ ★ ★ ★
★ ★
- Access 61 lectures & 2 hours of content 24/7
- Write unit tests confidently using JUnit
- Appreciate mocking & mock objects
- Use Mockito to create test fixtures, stub methods by programmatic & annotation-driven test setup
- Analyze production code to guide writing unit tests
- Gain an appreciation of the JUnit Assertions API
- Understand modern unit testing concepts & best practices
- Write assertions using Hamcrest
Specs
Important Details
- Length of time users can access this course: lifetime
- Access options: desktop & mobile
- Certificate of completion included
- Redemption deadline: redeem your code within 30 days of purchase
- Updates included
- Experience level required: beginner
- Have questions on how digital purchases work? Learn more here
Requirements
- Some knowledge of coding in Java to at least a basic level
$33.00 Value
Spring Boot Essentials
Matt Speake
48 Lessons (2h)
Lifetime
$33.00 Value
Mastering Spring Framework Fundamentals
Matt Speake
90 Lessons (5h)
Lifetime
$33.00 Value
Mastering Java 8 Fundamentals
Matt Speake
31 Lessons (2h)
Lifetime
Terms
- Unredeemed licenses can be returned for store credit within 30 days of purchase. Once your license is redeemed, all sales are final.
Your Cart
Your cart is empty. Continue Shopping!
Processing order...