public class

MockitoUtils

extends Object
java.lang.Object
   ↳ com.atlassian.confluence.MockitoUtils

Class Overview

Test utilities for Mockito.

Summary

Public Constructors
MockitoUtils()
Public Methods
static void clearMocks(Object target)
Set to null all @Mock annotated fields in the target object.
static void setField(Object target, Field field, Object value)
Sets the given field to the given value in the given target object.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public MockitoUtils ()

Public Methods

public static void clearMocks (Object target)

Set to null all @Mock annotated fields in the target object. TODO get this functionality made part of Mockito itself.

Parameters
target the object to process.

public static void setField (Object target, Field field, Object value)

Sets the given field to the given value in the given target object.

Parameters
target the target with the field to modify.
field the field to modify.
value the value to set.