In this post under Junit 5, I will show with example what is the purpose of and how to use AssertThrows feature. AssertThrows method checks whether the called method throws the user specified exception or not. If the user specified exception is thrown, the test passes otherwise the test fails. For our example, we will…… Continue reading AssertThrows example
Category: JUnit 5
Assertions using Supplier interface
In this post under JUnit 5, I will show with example, the new version of assert method which takes a Supplier interface implementation as an argument. In previous versions of JUnit, we have seen variety of assert methods, which takes the below arguments.1) The expected value (optional)2) The actual value (required)3) String message when the…… Continue reading Assertions using Supplier interface
JUnit 5 Simple example
In this post under JUnit 5, I will introduce to new version of JUnit with simple example. JUnit 5 is divided into three subprojects as shown below JUnit Platform –> This is the base subproject on which other subproject depends. It has TestEngine API which will be implemented by other subprojects. Its main purpose is…… Continue reading JUnit 5 Simple example