org.jasig.springframework.mockito
Class MockitoFactoryBean<T>
java.lang.Object
org.springframework.beans.factory.config.AbstractFactoryBean<T>
org.jasig.springframework.mockito.MockitoFactoryBean<T>
- Type Parameters:
T - Type of the mock instance to return
- All Implemented Interfaces:
- org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.FactoryBean<T>, org.springframework.beans.factory.InitializingBean
public class MockitoFactoryBean<T>
- extends org.springframework.beans.factory.config.AbstractFactoryBean<T>
Used to create a spring bean via Mockito
- Author:
- Eric Dalquist
| Fields inherited from class org.springframework.beans.factory.config.AbstractFactoryBean |
logger |
| Methods inherited from class org.springframework.beans.factory.config.AbstractFactoryBean |
afterPropertiesSet, destroy, getBeanFactory, getBeanTypeConverter, getEarlySingletonInterfaces, getObject, isSingleton, setBeanClassLoader, setBeanFactory, setSingleton |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MockitoFactoryBean
public MockitoFactoryBean(Class<? extends T> type)
resetAllMocks
public static void resetAllMocks()
- Reset all mocks that have been created with this factory, usually called from the @Before
method in a junit test case to reset mocks before each test
getObjectType
public Class<? extends T> getObjectType()
- Specified by:
getObjectType in interface org.springframework.beans.factory.FactoryBean<T>- Specified by:
getObjectType in class org.springframework.beans.factory.config.AbstractFactoryBean<T>
createInstance
protected T createInstance()
throws Exception
- Specified by:
createInstance in class org.springframework.beans.factory.config.AbstractFactoryBean<T>
- Throws:
Exception
destroyInstance
protected void destroyInstance(T instance)
throws Exception
- Overrides:
destroyInstance in class org.springframework.beans.factory.config.AbstractFactoryBean<T>
- Throws:
Exception
Copyright © 2013 Jasig. All Rights Reserved.