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
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
View Events Video Library
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Integrating PostgreSQL Databases with ANF: Join this workshop to learn how to create a PostgreSQL server using Instaclustr’s managed service

Mobile Database Essentials: Assess data needs, storage requirements, and more when leveraging databases for cloud and edge applications.

Monitoring and Observability for LLMs: Datadog and Google Cloud discuss how to achieve optimal AI model performance.

Automated Testing: The latest on architecture, TDD, and the benefits of AI and low-code tools.

Related

  • How To Validate HTTP Post Request Body - Restful Web Services With Spring Framework | Spring Boot
  • Spring Boot - Microservice- JaxRS Jersey - HATEOAS - JerseyTest - Integration
  • 4 Spring Annotations Every Java Developer Should Know
  • Performing Integration Tests on REST Services

Trending

  • Send Your Logs to Loki
  • Microservices With Apache Camel and Quarkus (Part 5)
  • Mastering Persistence: Why the Persistence Layer Is Crucial for Modern Java Applications
  • Effective Tips for Debugging Complex Code in Java
  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.

Tarun Telang user avatar by
Tarun Telang
CORE ·
Oct. 30, 18 · Tutorial
Like (6)
Save
Tweet
Share
37.44K Views

Join the DZone community and get the full member experience.

Join For Free

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
  • Spring Boot - Microservice- JaxRS Jersey - HATEOAS - JerseyTest - Integration
  • 4 Spring Annotations Every Java Developer Should Know
  • Performing Integration Tests on REST Services

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

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

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends: