Skip to content

Code Recipes Blog

Welcome to Programming Learning Center.

Month: April 2016

Using ArgumentCaptor class

April 1, 2016September 16, 2023 Posted in MockitoLeave a comment

This post explains how to capture arguments passed to mocked methods when testing. Suppose we have classes as shown below class Class1 { private Class2 class2; public void method1(int val) { val = val * val; class2.method2(val); } } class Class2 { private int val; public void method2(int val) { this.val = val; } }…… Continue reading Using ArgumentCaptor class

ArgumentCaptorMockito

Posts navigation

Next Posts
  • JCache
  • PowerMock
  • Java Scripting
  • Jackson
    • JSON
      • Streaming
      • Binding
      • Object Model
    • YAML
      • Streaming
      • Binding
  • Hibernate
    • ORM
  • JSONP
    • Object Model
    • Streaming
    • JSON Pointer
    • JSON Patch
  • Mockito
  • Java
    • Zip
    • GZip
    • Printer
    • Jar
    • Logging
    • DateTime
    • Core
      • String
      • Reflection
      • Interface
      • NIO
      • IO
      • Function
      • Collections
      • Record
      • Sealed
    • Security
  • JAXB
  • Quartz Scheduler
  • JAX-RS
  • Gradle
  • JSONB
    • Common
    • Deserialization
    • Serialization
  • JAXP
    • SAX
    • DOM
  • Spring Batch
    • Non-XML
    • XML
  • JQuery
  • Gson
    • Object Binding
    • JSON streaming
    • General
  • Apache Common Collections
  • Spring Framework
    • Spring Core
    • SpEL
  • YamlBeans
  • JMS
  • Java Mail
  • RxJava
    • Observable
    • Observer
  • Jsoup
  • Spring Retry
    • Annotation
    • XML Configuration
      • Non Spring AOP
      • Spring AOP
    • Builder Pattern
  • Apache Pool
  • JUnit 5
  • JJWT
  • JAX-RS Client
  • Apache Excel
  • Lombok
  • TestContainers
  • DotEnv
  • Spring WebClient
  • Passay
  • Java LDAP
  • MapStruct
  • BastiaanJansen OTP
  • Apache Commons IO
    • IO Utils
  • Spring RestTemplate
  • Index By Month
  • Index By Category
  • About
Blog at WordPress.com. Code Recipes Blog
Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy
  • Subscribe Subscribed
    • Code Recipes Blog
    • Already have a WordPress.com account? Log in now.
    • Code Recipes Blog
    • Subscribe Subscribed
    • Sign up
    • Log in
    • Report this content
    • View site in Reader
    • Manage subscriptions
    • Collapse this bar