DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Newsletter
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • How To Validate HTTP Post Request Body - Restful Web Services With Spring Framework | Spring Boot
  • A Guide to Enhanced Debugging and Record-Keeping
  • Best Practices for Writing Unit Tests: A Comprehensive Guide
  • Spring Boot - How To Use Native SQL Queries | Restful Web Services

Trending

  • Your Event Storming Is Not Your Software Design
  • Data Integration Landscape 2026: Event Streaming, API, and Batch in the Era of Agentic AI
  • Genkit Flows on Kubernetes, Routed by a Decision Model: senro + jev in Go
  • AI-Powered CI Test Failure Triage

Draft This article hasn't been published, so readers can't see it.

In moderation This article is waiting for review, so readers can't see it yet.

Deleted This article has been deleted, so readers can't see it.

  1. DZone
  2. Testing, Deployment, and Maintenance
  3. Testing, Tools, and Frameworks
  4. Mocking With the Mockito Framework and Testing REST APIs [Video]

Mocking With the Mockito Framework and Testing REST APIs [Video]

This video tutorial covers the Mockito framework and testing REST APIs/services.

By 
Tarun Telang
·
Oct. 30, 18 · Tutorial
Post on X (opens in a new tab) Share on LinkedIn (opens in a new tab)
38.4K Views

Join the DZone community Save articles, join the discussion, and download Refcards and Trend Reports with a free account.

Join for free Already a member? Log in

Overview

This session covers the following topics:

  • Recap of the Unit Testing session -  Introduction to Unit Tests in Java using JUnit 5 [Video]

  • Recap of Test Driven Development (TDD) session -  JUnit5 Deep Dive Using Test Driven Development [Video]

  • Introduction to following terminologies and their differences

    • Dummy Class
    • Fake Class
    • Stub Class
    • Mock Class
  • Basics of Spring Boot

  • Testing REST services with example service for Hello World and Factorial

  • Mocking with the Mockito framework

Pre-Requisites

  • You should have Spring Tools Suite (STS) 4 or Any other open source IDE installed on your laptop with Java SDK 1.8.
  • Some understanding of dependency management and build tools like Ant, Maven or Gradle would be helpful but not essentially required.
  • familiarity with Unit Testing using JUnit (As covered in the previous session)
  • For maximum benefit from this session, you can try out the step together while watching this on your computer.

Note: No slides were presented during this session; concepts were explained using Live Coding.


REST Web Protocols unit test Framework Mockito Spring Framework Test-driven development

Opinions expressed by DZone contributors are their own.

Related

  • How To Validate HTTP Post Request Body - Restful Web Services With Spring Framework | Spring Boot
  • A Guide to Enhanced Debugging and Record-Keeping
  • Best Practices for Writing Unit Tests: A Comprehensive Guide
  • Spring Boot - How To Use Native SQL Queries | Restful Web Services

Partner Resources

×

Comments

Loading comments

The comments didn't load

Please try again in a moment.

Likes

Loading

The next likes didn't load. Please try again.

The likes didn't load

Please try again in a moment.

See who liked this

Log in or join DZone for free to see who liked this article.

Log in Join for free
  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook