JUnit 5 Tutorial - Crash Course

Sdílet
Vložit
  • čas přidán 1. 08. 2024
  • Ever looked for a comprehensive intro to JUnit 5 that is fun and entertaining at the same time? Then have a look at this brand-new episode of "Marco Codes": JUnit 5 Tutorial [Crash Course].
    In this video, you'll learn how to use JUnit 5 like a professional. Understand what Maven/Gradle dependencies you'll need, how to write tests, how to use other assertion libraries like AssertJ and asserting JSON & XML, and explore new JUnit 5 features like @ParameterizedTests, @TestFactorys, and @ExtendWith. By the end of the tutorial, there won't be many questions left when it comes to JUnit 5.
    ► References
    jb.gg/xbe9vg
    ► Table Of Contents
    00:00 Intro
    00:17 Project Skeleton Overview
    00:35 Maven/Gradle Dependencies
    01:52 Project Overview - Classes
    02:11 First Test Class & Fixture
    03:02 @Test methods
    04:59 First Test Run
    05:23 Mvn + Junit5 Issues
    07:12 JUnit Assertions
    08:35 AssertJ - assertThat
    13:40 @DisplayName
    14:41 JSON Unit - Asserting JSON
    17:34 XML Unit - Asserting XML
    20:29 Lifecycle Intro
    21:10 @BeforeEach
    21:29 @AfterEach
    22:15 @BeforeAll / @AfterAll
    23:13 @ParameterizedTest
    24:12 @ParameterizedTest - @ValueSource
    25:22 @ParameterizedTest - @CSV Sources
    26:47 @ParameterizedTest - @EnumSource
    27:12 @TestFactory - Creating Dynamic Tests
    31:34 @Tag
    32:51 @ExtendWith - 3rd Party Integrations
    35:24 Outro
    ► FOLLOW ME
    / marcobehler
    www.marcobehler.com

Komentáře • 49

  • @marcobehler1395
    @marcobehler1395 Před 2 lety +3

    ► Timestamps
    00:00 Intro
    00:17 Project Skeleton Overview
    00:35 Maven/Gradle Dependencies
    01:52 Project Overview - Classes
    02:11 First Test Class & Fixture
    03:02 @Test methods
    04:59 First Test Run
    05:23 Mvn + Junit5 Issues
    07:12 JUnit Assertions
    08:35 AssertJ - assertThat
    13:40 @DisplayName
    14:41 JSON Unit - Asserting JSON
    17:34 XML Unit - Asserting XML
    20:29 Lifecycle Intro
    21:10 @BeforeEach
    21:29 @AfterEach
    22:15 @BeforeAll / @AfterAll
    23:13 @ParameterizedTest
    24:12 @ParameterizedTest - @ValueSource
    25:22 @ParameterizedTest - @CSV Sources
    26:47 @ParameterizedTest - @EnumSource
    27:12 @TestFactory - Creating Dynamic Tests
    31:34 @Tag
    32:51 @ExtendWith - 3rd Party Integrations
    35:24 Outro

  • @renaldywijayaputra6560
    @renaldywijayaputra6560 Před 21 dnem

    i like the way you said "and thats all for the boring tasks", thank you for the amazing course by the way🔥

  • @valeriotrinca5346
    @valeriotrinca5346 Před 2 lety +9

    You explain the concepts very well, I hope you will continue to create more tutorials on topics like these

  • @badripaudel77
    @badripaudel77 Před 2 lety

    Content is so qualified. Love to see more on testing 🙂

  • @jeremiahsprague2584
    @jeremiahsprague2584 Před 2 měsíci

    So glad I found your channel, high quality content, compared to other channels I've seen it has so much depth. Thank you!!!

  • @martinmiano8220
    @martinmiano8220 Před 11 měsíci

    Fantastic work Marco Codes

  • @RobsonCassianoSoftware

    I've started being confident with Unit Tests, thanks!

  • @andreialexandru7027
    @andreialexandru7027 Před 2 lety +1

    I learned a lot of things from you Mr. Marco Behler! I also follow your other channel, which also has some very good tutorials! Thank you! I wish you a lot of subscribers and likes because you're doing a great job!

  • @mercury801115
    @mercury801115 Před 2 lety +8

    You’re a fantastic instructor!

  • @honsu920
    @honsu920 Před rokem

    Hey, Marco! Thank you for the great content! Your explanations are clear and quite sufficient. Plus you demonstrate all things using modern IDE and library versions. Super cool! I would really like to see your video about testing in general: unit vs integration tests, what is a test case, edge case, how many tests to write, what to cover with tests and what not to cover... maybe some short insight into CI/CD - how to run tests, see results, coverage... There are almost no good videos on youtube summarizing all these.

  • @rasulrzaeeff6772
    @rasulrzaeeff6772 Před 2 lety

    Marco you are really explain all topics so clearly. Good luck we all love your articles and videos ;)

  • @ThinkScienceCanada
    @ThinkScienceCanada Před 2 měsíci

    amazing video, thank you

  • @slimandahra4294
    @slimandahra4294 Před rokem

    i like your way of explaination...just to the point...nothing else and not too much empty talking..thank u and good luck

  • @enfieldli9296
    @enfieldli9296 Před 2 lety +1

    I'm visibly confused on what to test rather than how to test lol , anyway, can't wait to see the upcomming unit/integration test videos!

  • @enfieldli9296
    @enfieldli9296 Před 2 lety

    "If you want to be passive aggressive, you can do this..." this line cracks me up, LMAO

  • @user-ec4rx6nk7x
    @user-ec4rx6nk7x Před rokem

    Awesome tutorial

  • @user-ib8rv1vr4r
    @user-ib8rv1vr4r Před 2 lety

    What is the amazing content! I find your videos extremely useful. Why? You give a nice look around. For example, during learning Spring JDBC Template library, I got to know about what is connection pooling. And I really appreciate your video content.
    Thnx, Marco!

    • @MarcoCodes
      @MarcoCodes  Před 2 lety +1

      Thank you for those nice words, Bogdan! Happy you're enjoying it.

  • @Jod4light
    @Jod4light Před 2 lety

    Awesome!

  • @MattThomasLondon
    @MattThomasLondon Před 7 měsíci

    Fantastic presentation - rare to see a white screen demo these days which to me works better for demos

  • @asterixcode
    @asterixcode Před rokem

    a video about integration tests would be amazing :) and as an extra an integration test from api endpoint, consuming from kafka and saving in a db :)))

  • @halasamir3505
    @halasamir3505 Před 2 lety

    Great! keep it up :)

  • @adaworoag
    @adaworoag Před 2 lety

    Good content 🙂

  • @user-ib8rv1vr4r
    @user-ib8rv1vr4r Před 2 lety

    Beautiful content. Google has just suggested me your Gradle video. Coooool! I was looking for it for several days. Let me go watching!
    PS: Marco, could you also make video about Mockito? It would be niiiice.)

    • @MarcoCodes
      @MarcoCodes  Před 2 lety +1

      Mockito is actually in the backlog, I'll see what I can do :)

  • @abdiafrah4907
    @abdiafrah4907 Před rokem

    Suddenly I like testing again 😂

  • @electricant55
    @electricant55 Před rokem

    Man, thank god for Spock

  • @Kevin-gr5rs
    @Kevin-gr5rs Před 2 lety +1

    First to comment for the first time in my life. I have now completed one of my life goals 🚀

    • @MarcoCodes
      @MarcoCodes  Před 2 lety +1

      I love the spirit @Kevin :) !

    • @Kevin-gr5rs
      @Kevin-gr5rs Před 2 lety

      @@MarcoCodes I hope you will do many more Java videos. I just landed my first backend job with not a lot of experience. So need to learn a lot.

  • @feici02
    @feici02 Před 2 lety +1

    8:28 expected should be the first parameter of the assertEquals method. I often make the same error. 😀

  • @sidremey
    @sidremey Před 2 lety

    1:51 Strangely, IDEA did not add test even though you told it the scope you wanted in the dependency manager.

    • @MarcoCodes
      @MarcoCodes  Před 2 lety +1

      Very good catch, didn't even notice that! Seems like a bug, because I just tried it out and it worked, interesting. Thank you!

  • @samank2847
    @samank2847 Před 2 lety

    hey nice video I did just subscribe. nice content. A docker video would be nice maybe using docker desktop :)

    • @MarcoCodes
      @MarcoCodes  Před 2 lety

      Anything specific you'd like to see covered in that video?

  • @user-ec4rx6nk7x
    @user-ec4rx6nk7x Před rokem

    Very impatient to see a Quarkus tutorial from you.

    • @MarcoCodes
      @MarcoCodes  Před rokem

      Unfortunately not coming anytime soon.

  • @milanpronic9424
    @milanpronic9424 Před 4 měsíci

    you should show full code of class like User

  • @berndeckenfels
    @berndeckenfels Před 2 lety

    Interesting it did not run setup/cleanup for the dynamic tests.

    • @MarcoCodes
      @MarcoCodes  Před 2 lety +1

      Yup, good catch! You might want to read the "Dynamic Test Lifecycle" section here in the documentation: junit.org/junit5/docs/snapshot/user-guide/#writing-tests-dynamic-tests

  • @anthroponymy
    @anthroponymy Před 2 lety

    Hi please use the Wind Muff for you Audio Microphone. you voice is very clear and loud but the wind noise from your voice is not good.

    • @MarcoCodes
      @MarcoCodes  Před 2 lety +1

      Any specific locations in the video where that happens?

    • @anthroponymy
      @anthroponymy Před 2 lety

      @@MarcoCodes at the start "junit junit" the song and "test of test" at the intro end at the "quick caveat" and also at many place when you come close to the microphone. or place your microphone at the TOP. czcams.com/video/arCe4UNwwYg/video.html

  • @sandrodelacruz8125
    @sandrodelacruz8125 Před rokem

    Homogeneous- the g is pronounced as j.