JUnit testing is java unit testing. Writing and running a JUnit test involves easy steps.
Steps to Write and run a JUnit test case:
-
Create a class
-
Write a test method (annotated with
@Test
) that asserts expected results on the object under test -
Although writing a
main()
method to run the test is much less important it is good to write a main method. -
Run the test