The Baeldung logo
  • The Baeldung Logo
  • Start Here
  • Courses ▼▲
    • REST with Spring

      The canonical reference for building a production grade API with Spring

    • Learn Spring Security ▼▲

      THE unique Spring Security education if you’re working with Java today

      • Learn Spring Security Core

        Focus on the Core of Spring Security 5

      • Learn Spring Security OAuth

        Focus on the new OAuth2 stack in Spring Security 5

    • Learn Spring

      From no experience to actually building stuff​

    • Learn Spring Data JPA

      The full guide to persistence with Spring Data JPA

  • Guides ▼▲
    • Persistence

      The Persistence with Spring guides

    • REST

      The guides on building REST APIs with Spring

    • Security

      The Spring Security guides

  • About ▼▲
    • Full Archive

      The high level overview of all the articles on the site.

    • Baeldung Ebooks

      Discover all of our eBooks

    • About Baeldung

      About Baeldung.

Testing » Mocking

Testing is a very important aspect to building a stable application. Learn how to use different Java-based testing tools through the guides below.

  • JUnit (58)
  • Mockito (36)
  • JUnit 5 (35)
  • x Mocking (12)
  • Selenium (11)
  • JMeter (11)
  • AssertJ (10)
  • Matchers (8)
  • Hamcrest (8)
  • Cucumber (7)
  • REST Assured (6)
  • TestNG (6)
  • JMockit (6)
  • Gatling (5)

>> Mock Static Method using JMockit

>> Mockito.mock() vs @Mock vs @MockBean

>> EasyMock Argument Matchers

>> Introduction to EasyMock

>> Mock Final Classes and Methods with Mockito

>> Mocking of Private Methods Using PowerMock

>> Mocking Void Methods with Mockito

>> Mocking Exception Throwing using Mockito

>> Mockito – Using Spies

>> Mockito When/Then Cookbook

>> Mockito Verify Cookbook

>> Avoid Brittle Tests for the Service Layer

  • ↑ Back to Top
res – Junit (guide) (cat=Testing)
opt-in
Quick Guide to Take Advantage of JUnit 5
Download the E-book
The Baeldung logo

Courses

  • All Courses
  • All Bulk Courses
  • All Bulk Team Courses
  • The Courses Platform

Series

  • Java “Back to Basics” Tutorial
  • Jackson JSON Tutorial
  • Apache HttpClient Tutorial
  • REST with Spring Tutorial
  • Spring Persistence Tutorial
  • Security with Spring
  • Spring Reactive Tutorials

About

  • About Baeldung
  • The Full Archive
  • Editors
  • Jobs
  • Our Partners
  • Partner with Baeldung
  • Terms of Service
  • Privacy Policy
  • Company Info
  • Contact
The Baeldung Logo