com.gwtplatform.tester
Class MockProvider<T>
java.lang.Object
com.gwtplatform.tester.MockProvider<T>
- Type Parameters:
T - The type of mock object provided
- All Implemented Interfaces:
- javax.inject.Provider<T>
public class MockProvider<T>
- extends Object
- implements Provider<T>
For use in test cases where an Provider is required to provide an
object and the test case needs to provide a mock of the object.
Note that the same mock will be returned for every invocation of {get()
(it behaves as a singleton) which may impact your tests, for example
if you rely on ==. If you're using mockito, consider using the
MockProvider instead.
- Author:
- Brendan Doherty
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MockProvider
public MockProvider(T mock)
- Construct a
Provider that will provide the mock object.
- Parameters:
mock - The mock object to provide.
get
public T get()
- Specified by:
get in interface javax.inject.Provider<T>
Copyright © 2010-2011 ArcBees. All Rights Reserved.