1import org.junit.jupiter.api.Assertions;
2import org.junit.jupiter.api.Test;
3
4public class AssertionExample {
5
6 /**
7 * The assertionExample function
8 * uses multiple assertions for the purpose of example;
9 * Usually in one method it is recommended to have 1 assertion;
10 */
11 @Test
12 public void assertionExample()
13 {
14 Assertions.assertEquals(2+2,4);
15
16 Assertions.assertNotEquals(6+3,10);
17
18 Assertions.assertTrue("Radu".length()==4);
19
20 String tester = null;
21
22 Assertions.assertThrows(NullPointerException.class,()->tester.equals("emptyString"));
23 }
24}
25