• 27 February

    JUnit assertSame example

    Junit 5’s org.junit.jupiter.Assertions class provides different static assertions method to write test cases. Please note that you need to use JUnit’s org.junit.Assert class in case of JUnit 4 or JUnit 3 to assert using assertNull method. Assertions.assertSame() checks whether expected and actual object refer to same object. In case, both do not refer to same […]

  • 23 September

    JUnit assertFalse example

    Junit 5’s org.junit.jupiter.Assertions class provides different static assertions method to write test cases. Please note that you need to use JUnit’s org.junit.Assert class in case of JUnit 4 or JUnit 3 to assert using assertFalse method. Assertions.AssertFalse() checks if supplied boolean condition is false. In case, condition is true, it will through AssertError. public static […]

  • 19 September

    JUnit assertTrue example

    Junit 5’s org.junit.jupiter.Assertions class provides different static assertions method to write test cases. Please note that you need to use JUnit’s org.junit.Assert class in case of JUnit 4 or JUnit 3 to assert using assertTrue method. Assertions.assertTrue() checks if supplied boolean condition is true. In case, condition is false, it will through AssertError. public static […]

  • 16 September

    JUnit assertEquals example

    Junit 5’s org.junit.jupiter.Assertions class provides different static assertions method to write test cases. Please note that you need to use JUnit’s org.junit.Assert class in case of JUnit 4 or JUnit 3 to assert using assertEquals method. assertEquals usage Assertions.assertEquals() checks if expected and actual are equal. In case, both are not equal, it will through […]

  • 11 September

    Junit assertNotNull example

    Junit 5’s org.junit.jupiter.Assertions class provides different static assertions method to write test cases. Please note that you need to use JUnit’s org.junit.Assert class in case of JUnit 4 or JUnit 3 to assert using assertNotNull method. Assertions.assertNotNull() checks if object is not null. In case, object is null, it will through AssertError. public static void […]

  • 11 September

    JUnit assertNull example

    Junit 5’s org.junit.jupiter.Assertions class provides different static assertions method to write test cases. Please note that you need to use JUnit’s org.junit.Assert class in case of JUnit 4 or JUnit 3 to assert using assertNull method. Assertions.assertNull() checks that object is null. In case, object is not null, it will through AssertError. public static void […]

  • 10 September

    JUnit assertNotSame example

    Junit 5’s org.junit.jupiter.Assertions class provides different static assertions method to write test cases. Please note that you need to use JUnit’s org.junit.Assert class in case of JUnit 4 or JUnit 3 to assert using assertNull method. Assertions.assertNotSame() checks whether expected and actual object refer to different objects. In case, both refer to same object, it […]