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

Unit Testing with JUnit

Unit Testing with JUnit

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