com.gwtplatform.tester
Class MockProvider<T>

java.lang.Object
  extended by 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

Constructor Summary
MockProvider(T mock)
          Construct a Provider that will provide the mock object.
 
Method Summary
 T get()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MockProvider

public MockProvider(T mock)
Construct a Provider that will provide the mock object.

Parameters:
mock - The mock object to provide.
Method Detail

get

public T get()
Specified by:
get in interface javax.inject.Provider<T>


Copyright © 2010-2011 ArcBees. All Rights Reserved.