Course outline for JUnit and Mockito

Pre-requisites for learning JUnit and Mockito

  • The participants must be comfortable with programming constructs in Java

Lab Setup

  • Hardware Configuration - Participants must have access to a system with the following hardware configuration
    • 2GB of free RAM, 20GB of free disk space and full network connectivity
  • Software Configuration
    • Ubuntu 20.04/22.04 Desktop Edition (sudo/root access required)
    • Firefox and Chrome Browsers
    • Install - JDK

Duration

  • 2-3 days

Training Mode

Online training for JUnit and Mockito

We provide:

  • Instructor led live training
  • Self-paced learning with access to expert coaches
  • 24x7 access to cloud labs with end to end working examples

All jnaapti sessions are 100% hands-on. All our instructors are engineers by heart. Activities are derived from real-life problems faced by our expert faculty. Self-paced hands-on sessions are delivered via Virtual Coach.

Classroom training for JUnit and Mockito

Classroom sessions are conducted in client locations in:

  • Bengaluru
  • Chennai
  • Hyderabad
  • Mumbai
  • Delhi/Gurgaon/NCR

Note: Classroom training is for corporate clients only

Detailed Course Outline for JUnit and Mockito

Introduction to JUnit

  • Installation and Environment setup
  • Need of JUnit testing
  • JUnit testing - “Hello World”

JUnit Testing Framework

  • Assert class
  • TestCase class
  • TestSuit class
  • TestResult class

Assertions and Annotations

  • Learn about various JUnit test methods
  • Learn about basic JUnit Annotations
  • Creating a simple test

Advanced Concepts

  • Aggregating tests in suites
  • Parameterized tests
  • Exception testing
  • Timeout for tests

JUnit extensions and tools

  • XMLUnit
  • MockObject
  • EvoSuite
  • Other JUnit extensions and tools

Mockito

  • Introduction to Mocking
  • Integration with JUnit
  • Expecting and Varying Calls
  • Exception Handling

More about Mockito

  • Methods to create mock objects
  • Configuring mocks
  • Verifying method call order
  • Calling Callbacks with Mockito
  • Spies in Mockito
  • Reseting and Reusing mocks