5910 Breckenridge Pkwy Suite B, Tampa, FL. 33610
(800) 272-0707

SkillSoft Explore Course

Aspire     Javanista to Java Master     Javanista to Java Master Track 1: Unit Testing
Assertions, a collection of utility methods in in JUnit, help assert the pass or fail status of test cases. The focus of this course is on assertions that allow you to set the conditions for the success and failure of test cases and assumptions to control the flow of execution in a test case.
Begin with simple assert methods to compare the actual values of fields or return values of methods with their expected values. Then, use assertions that ensure your app's performance by failing a test if it takes too long to run, followed by assert methods that check an exception is thrown when invalid data is passed to a method. Next, use assumptions that check for conditions before executing a code block - effectively serving as control structures.
When you're done, you'll have a working knowledge of using assertions in JUnit.

Objectives

Unit Testing: Assertions & Assumptions in JUnit

  • discover the key concepts covered in this course
  • set a test to check that an actual value generated by a unit in an app matches the expected value
  • implement test cases that verify Boolean data and objects
  • develop test cases that ensure a unit of an app can run within a specified time
  • build tests to verify that method calls throw an exception when invalid data is passed to it
  • define a group of asserts and check whether two iterable objects contain the same data
  • configure a test case to execute only when a specified assumption is satisfied
  • set a block of code to execute when a specified assumption is met
  • summarize the key concepts covered in this course