JUnit 5 Parameterized Tests with @ValueSource | Coding with BibBobBib

Published: 01 February 2024
on channel: Coding With BibBobBib
25
5

HEJA coding people, I hope you're well.

CONTENT
Learn how to write parameterized tests in JUnit 5 using @ParameterizedTest and @ValueSource.

In this beginner-friendly Java testing tutorial, I’ll create a JUnit 5 test class for an existing Java class. We’ll first write a regular unit test, then convert the test into a parameterized test that runs multiple times with different input values.

WHAT IN THIS VIDEO
Create a JUnit 5 test class
Write and run a basic unit test
Understand the `@ParameterizedTest` annotation
Supply multiple test inputs with `@ValueSource`
Run the same test with different values
Reduce duplicated test methods

CODE USED IN THIS VIDEO
The Java class under test was created in Coding Session 13:
   • Spring Boot Custom Validation with Constra...  

TIMESTAMPS
00:00 Introduction | Coding Session 16
00:07 JUnit 5 tutorial overview
00:13 What is `@ParameterizedTest`?
00:20 Review the Java class under test
00:26 Create the JUnit 5 test class
00:46 Write and run the first test
03:30 What is `@ValueSource`?
03:46 Create the parameterized test
05:26 More coding sessions

TOOLS
Intellij IDEA Community Edition

FRAMEWORKS
spring boot, maven, java 17, junit 5

TIPP CODING SESSIONS
class under test, created in this session    • Spring Boot Custom Validation with Constra...  

FOLLOW along to see what comes next.    / @codingwithbibbobbib  

MUSIC
licensed with Epidemic Sound
https://www.epidemicsound.com

#codingwithbibbobbib #coding #howto #livecoding #junit #junit5 #springboot #springboottutorial #javatest #test #refactoring #programming #intelliJIDEA #intelliJ #Java


On this page of the site you can watch the video online JUnit 5 Parameterized Tests with @ValueSource | Coding with BibBobBib with a duration of hours minute second in good quality, which was uploaded by the user Coding With BibBobBib 01 February 2024, share the link with friends and acquaintances, this video has already been watched 25 times on youtube and it was liked by 5 viewers. Enjoy your viewing!