public class CachingSpy extends Object implements org.mockito.stubbing.Answer<Object>
| Modifier and Type | Class and Description |
|---|---|
static interface |
CachingSpy.FileNameConstructor
This can be implemented by someone who wants to change how the files are
named for a certain method.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
addFileNameConstructor(Method method,
CachingSpy.FileNameConstructor fileNameConstructor)
This can be used to define an own file name constructor for naming files
in case hashCode is implemented in a bad way.
|
Object |
answer(org.mockito.invocation.InvocationOnMock invocation)
Implement answer for caching spy.
|
static <T> T |
cachingSpy(T object)
This method intercepts all calls to object and returns if available a
serialized object from the cache in the test directory.
|
static <T> T |
cachingSpy(T object,
Method[] methodsToCache)
This method intercepts all calls to object and returns if available a
serialized object from the cache in the test directory.
|
static <T extends K,K> |
cachingSpyForFinalClass(Class<K> clazz,
T object)
This function creates a decorator for an object that has a final class.
|
static <T extends K,K> |
cachingSpyForFinalClass(Class<K> clazz,
T object,
Method[] methodsToCache)
This function creates a decorator for an object that has a final class.
|
static void |
removeFileNameConstructor(Method method)
This can be used to remove an own file name constructor for naming files
in case hashCode is implemented in a bad way.
|
public static <T> T cachingSpy(T object)
object - the object to spy onmethods - list of methods which should be cachedpublic static <T> T cachingSpy(T object,
Method[] methodsToCache)
object - the object to spy onmethodsToCache - list of methods which should be cachedpublic static <T extends K,K> K cachingSpyForFinalClass(Class<K> clazz, T object)
clazz - object - public static <T extends K,K> K cachingSpyForFinalClass(Class<K> clazz, T object, Method[] methodsToCache)
clazz - object - public Object answer(org.mockito.invocation.InvocationOnMock invocation) throws Throwable
public static void addFileNameConstructor(Method method, CachingSpy.FileNameConstructor fileNameConstructor)
method - fileNameConstructor - public static void removeFileNameConstructor(Method method)
method - Copyright © 2014 Apaxo GmbH. All rights reserved.