The Java org.testng.AssertJUnit package is a library for performing assertions in test cases using TestNG framework. The package provides a set of pre-defined assertion methods that can be used to verify expected test results.
Code Examples:
1. AssertEquals: This method tests whether two values are equal or not. If they are not equal, the test will fail.
AssertJUnit.assertEquals("Hello", "Hello");
2. AssertTrue: This method tests whether a given condition is true or not. If the condition is false, the test will fail.
AssertJUnit.assertTrue(10 > 5);
3. AssertFalse: This method tests whether a given condition is false or not. If the condition is true, the test will fail.
AssertJUnit.assertFalse(5 < 2);
4. AssertNotNull: This method tests whether a given object is null or not. If the object is null, the test will fail.
AssertJUnit.assertNotNull("Hello");
The package library is "org.testng.AssertJUnit".
Java AssertJUnit - 30 examples found. These are the top rated real world Java examples of org.testng.AssertJUnit extracted from open source projects. You can rate examples to help us improve the quality of examples.