Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Unit Testing with JUnit

Sponsored · SiteGround - Reliable hosting with speed, security, and support you can count on.

Unit Testing with JUnit

Avatar for Ebru Akagündüz

Ebru Akagündüz

April 21, 2022
Tweet

More Decks by Ebru Akagündüz

Other Decks in Technology

Transcript

  1. Junit • Introduction ◦ Kent Beck & Erich Gamma, 1997

    ◦ Current version: 5.8.2 ◦ JUnit5 = JUnit Platform + JUnit Jupiter + JUnit Vintage ◦ org.junit.*
  2. Annotations @BeforeEach - @AfterEach: are called before each and after

    each @Test methods. @BeforeAll - @AfterAll: are static methods because, as the name suggest they are called once before all and once after all @Test methods. @DisplayName: can be used for classess and @Test methods as well. @Disabled: can be used for classess and @Test methods as well. @DisabledOnOS @Nested @TestClassOrder - @Order @ParameterizedTest @ValueSource: an argument array to pass @ParameterizedTest @RepeatedTest