Testing for Exceptions - JUnit Tutorial

Поделиться
HTML-код
  • Опубликовано: 22 авг 2024
  • Learn how you can test for expected exceptions that are thrown from your methods with JUnit.
    With just a single line, we can increase our test coverage to expect exceptions to be thrown from our class behaviour.
    Link to GitHub repo: github.com/4ne...
    Comment, like and subscribe for more content on Java and software engineering.
    Visit my website to also see my blogs: aneesh.co.uk

Комментарии • 7

  • @minigirl
    @minigirl 10 месяцев назад +1

    Nice, thank you!

  • @hbycodingacademic7667
    @hbycodingacademic7667 Год назад

    For the class with only static methods, they no need to be instantiated. How to write the unit test for the uncovered code "public class Cashier"?

  • @Young10489
    @Young10489 2 года назад +3

    binge watching ing...

  • @shubhamgarg5007
    @shubhamgarg5007 Год назад +2

    will it work in junit 5?

    • @AneeshMistry
      @AneeshMistry  6 месяцев назад

      Yes it should do as these are backward compatible