title
Please take a moment to fill out this form. We will get back to you as soon as possible.
All fields marked with an asterisk (*) are mandatory.
Java Testing with JUnit 5
Course Description
Overview
This course introduces experienced Java developers to the fundamentals and best practices in unit testing. It uses the JUnit 5 and Mockito libraries, both of which are ubiquitous in the Java community. It is intended for both developers who are new to testing, as well as those who are already familiar with it, but want more experience with testing using JUnit 5. Note that JUnit 5 is substantively different than JUnit 4.Although the core testing principles are the same, there are substantial implementation differences, important new features, and a brand new extension model. Testing with mocks is covered in detail, using Mockito. We explore testing enterprise components in the persistence, service, and web layers, outlining the issues involved in each. In-container testing is introduced as a more meaningful approach to testing enterprise components, vs. standalone testing with mocks, and we examine this at each of the main layers in an enterprise application.
Objectives
Audience
Prerequisites
-
The student is expected to have a good working knowledge of Java and OO, including the use of interfaces, abstract classes, collections, factories, and generics. Experience with Java 8 lambda expressions is helpful, but not strictly required. A brief primer on the Java 8 features employed by JUnit is included in the course.
Topics
- Overview
- Agenda
- Conventions
- Objectives
- 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
- Test Methods
- All about Expectations
- Point Assertions
- Messages
- Messages - Useful or Not?
- Messages - a Practical Approach
- 1.2 - Tests and Assertions
- Fixtures - @BeforeEach and @AfterEach
- Fixtures - Example
- and @AfterAll
- of Execution - Full Test Lifecycle
- Instance Creation
- Lifecycle
- 1.3 - Test Fixtures and Lifecycle
- 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>
- for Exceptions
- for Exceptions - Example
- Timeouts
- Timeouts - Example
- Groups
- Groups - Example
- 2.1 - Exceptions, Assertion Groups, and Timeouts
- 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
- 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
- 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
- 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
- Objectives
- of Mock Objects
- as Collaborators
- Mockito
- 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
- Matchers
- Argument Matchers
- Mocking with Spies
- the Unmockable
- Injection of Mocks
- Injection of Mocks
- 3.2 - Additional Capabilities [Optional HW]
- Objectives
- 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
- 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
- Issues, Different Layer
- It Worth It?
- Saved the Hardest for Last
- Issues, Easier Answer
- Testing Isn't Enough
- vs. Automated Testing
- as Much as Possible
- the Web Browser
- of What We've Done
- of What We've Done
Related Courses
-
Behavior and Test Driven Development using Junit
EJCJ-540- Duration: 3 Days
- Delivery Format: Classroom Training
- Price: 1,755.00 USD
-
Test Driven Development (TDD) and Unit Testing Essentials
EJCJ-521- Duration: 3 Days
- Delivery Format: Classroom Training, Online Training
- Price: 1,755.00 USD
Self-Paced Training Info
Learn at your own pace with anytime, anywhere training
- Same in-demand topics as instructor-led public and private classes.
- Standalone learning or supplemental reinforcement.
- e-Learning content varies by course and technology.
- View the Self-Paced version of this outline and what is included in the SPVC course.
- Learn more about e-Learning
Course Added To Shopping Cart
bla
bla
bla
bla
bla
bla
Self-Paced Training Terms & Conditions
Exam Terms & Conditions
Sorry, there are no classes that meet your criteria.
Please contact us to schedule a class.
STOP! Before You Leave
Save 0% on this course!
Take advantage of our online-only offer & save 0% on any course !
Promo Code skip0 will be applied to your registration
Purchase Information
title
Please take a moment to fill out this form. We will get back to you as soon as possible.
All fields marked with an asterisk (*) are mandatory.