Skip to content

Latest commit

 

History

History
33 lines (24 loc) · 1.22 KB

File metadata and controls

33 lines (24 loc) · 1.22 KB

Introduction to JUnit 5 with Maven

All source code examples in the repository are for my Online Course - Testing Spring Beginner to Guru

This source code repository contains JUnit 5 test examples with Maven.

Setup

Requirements

  • Should use Java 11 or higher. Previous versions of Java are un-tested.
  • Use Maven 3.5.2 or higher

Support

For questions and help:

  • Please post in course
  • Or post in the Slack Community exclusive to the course.

GitHub Issues will not be addressed.

  • Very Simple beforeClass/each/test/after/afterall guru.springframework.sfgpetclinig.controllers.IndexControllerTest
  • Group Assertions guru.springframework.sfgpetclinig.controllers.Person
  • Nested Test Classes: guru.springframework.sfgpetclinic.services.map.OwnerMapServiceTest
  • @RepeatedTest(x) : PersonRepeatedTest:...
  • ParameterizedTests : OwnerTest
    • quite useful

Tag annotation, to make groups of tests

  • Annotate a Class or Method with @Tag.
    • In IntelliJ, go to Run -> Edit Configuration -> Change Class to Tag and enter the Tag name. In the run dropdown (top-right) you can select different test groups
    • In Maven
    • In Gradle