Java Testing: Mastering Junit 5 Framework

Posted By: ELK1nG

Java Testing: Mastering Junit 5 Framework
Published 9/2024
MP4 | Video: h264, 1920x1080 | Audio: AAC, 44.1 KHz
Language: English | Size: 1.88 GB | Duration: 5h 1m

Learn how to perform Unit testing in Java using JUnit 5 framework. We use Java 21, JUnit 5, Maven, and IntelliJ IDEA.

What you'll learn

Learn to Write Unit tests using JUnit 5 Framework

JUnit Lifecycle Annotations

JUnit Assertions

JUnit Exception Testing

JUnit Test Suites

JUnit Parameterized Tests

JUnit Nested Tests

JUnit Disable Tests

JUnit Display Test Names

JUnit Repeated Tests

JUnit Test Execution Order

Requirements

Java

IntelliJ IDEA

Description

This course is designed for beginners and experienced programmers to learn everything about the JUnit framework from scratch. All dependencies and examples in this tutorial are up-to-date and use the latest version of JUnit (JUnit 5+).What is Unit Testing?Unit testing is a way to check small parts of your program, like individual functions or methods, to make sure they work correctly. The main goals of unit testing are to:Make sure each part of the program works as expected.Make it easier to change and improve the code.Ensure the program is reliable and bug-free.By focusing on small parts, developers can find and fix bugs early, leading to better and more stable programs.What is the JUnit 5 Framework?JUnit is a framework that allows developers to create and run tests easily. It helps you write tests that automatically check if your code works correctly. JUnit is widely used because it makes testing simple and helps ensure your code behaves as expected.JUnit Framework is a de-facto standard for writing unit tests in Java.JUnit is a commonly used testing framework for Java projects. Knowing how to use JUnit is a valuable skill for any Java developer.Writing tests with JUnit helps you find and fix bugs early in the development process, saving time and effort later.What You Will LearnHere are the key topics you’ll explore in this course:Introduction to JUnit 5Writing Your First JUnit TestSteps to Write JUnit TestsJUnit @Test AnnotationJUnit Lifecycle Annotations: JUnit @BeforeEach, @AfterEach, @BeforeAll and @AfterAll AnnotationsJUnit AssertionsJUnit Exception TestingJUnit Test SuitesJUnit Parameterized TestsJUnit Nested TestsJUnit Disable TestsJUnit Display Test NamesJUnit Repeated TestsJUnit Test Execution OrderTools and Technologies UsedJava 21MavenJUnit 5IntelliJ IDEA

Overview

Section 1: Introduction

Lecture 1 Introduction

Section 2: JUnit 5 - Getting Started

Lecture 2 What is Unit Testing?

Lecture 3 Introduction to JUnit

Lecture 4 JUnit Basic Concepts

Lecture 5 Setting Up the Environment for JUnit

Lecture 6 Writing Your First JUnit Test

Lecture 7 JUnit @Test Annotation

Section 3: JUnit 5 - Assertions

Lecture 8 JUnit assertTrue Method

Lecture 9 JUnit assertFalse Method

Lecture 10 JUnit assertNull Method

Lecture 11 JUnit assertNotNull Method

Lecture 12 JUnit assertEquals Method

Lecture 13 JUnit assertNotEquals Method

Lecture 14 JUnit assertArrayEquals Method

Lecture 15 JUnit assertIterableEquals Method

Section 4: JUnit 5 - Exception Testing

Lecture 16 JUnit assertThrows Method

Lecture 17 JUnit assertThrowsExactly Method

Section 5: JUnit 5 - Display Test Names and Disable Tests

Lecture 18 JUnit Display Test Names - @DisplayName

Lecture 19 JUnit Disable Tests - @Disabled

Section 6: JUnit 5 - Lifecycle Annotations

Lecture 20 JUnit Lifecycle Annotations

Lecture 21 @BeforeEach Annotation

Lecture 22 @AfterEach Annotation

Lecture 23 @BeforeAll Annotation

Lecture 24 @AfterAll Annotation

Section 7: JUnit 5 - Nested Tests and Repeated Tests

Lecture 25 JUnit Repeated Tests - @RepeatedTest Annotation

Lecture 26 JUnit Nested Tests - @Nested Annotation

Section 8: JUnit 5 - Test Execution Order

Lecture 27 JUnit Test Execution Order

Section 9: JUnit 5 - Test Suite

Lecture 28 JUnit Test Suite

Section 10: JUnit 5 - Parameterized Tests

Lecture 29 JUnit Parameterized Tests and Source Types

Lecture 30 ParameterizedTest Source Type - @ValueSource

Lecture 31 ParameterizedTest Source Type - @EnumSource

Lecture 32 @ParameterizedTest Source Type - @CsvSource

Lecture 33 ParameterizedTest Source Type - @CsvFileSource

Lecture 34 ParameterizedTest Source Type - @MethodSource

Lecture 35 ParameterizedTest Source Type - @ArgumentsSource

This course is for Java developers who want to learn complete JUnit 5 framework from the scratch.