Skip navigation

On September 14th, 2017, we published revised versions of our Privacy Policy, Terms of Service and Website Use Policy and published a Cookie Policy. Your continued use of Lynda.com means you agree to these revised documents, so please take a few minutes to read and understand them.

Basic unit tests

Basic unit tests: Java: Testing with JUnit
Basic unit tests: Java: Testing with JUnit

One of the benefits of JUnit tests is that it does not require human judgment to interpret, and it is easy to run many of them at the same time. When you need to test something, here are the steps you need to follow: Annotate a method with @Test as seen here in this simple calculator program import org.junit.Assert. Call assertEquals() with two values, the expected value and the result of testing the program class.

Resume Transcript Auto-Scroll
Skill Level Intermediate
1h 10m
Duration
85,712
Views
Show More Show Less
Skills covered in this course
Development Tools Developer Programming Languages Java

Continue Assessment

You started this assessment previously and didn't complete it. You can pick up where you left off, or start over.

Start Your Free Trial Now

Start your free trial now, and begin learning software, business and creative skills—anytime, anywhere—with video instruction from recognized industry experts.

Start Your Free Trial Now