Class FakeRequestContext
- java.lang.Object
-
- com.google.web.bindery.requestfactory.shared.testing.FakeRequestContext
-
- All Implemented Interfaces:
RequestContext
public class FakeRequestContext extends java.lang.Object implements RequestContext
A no-op implementation of RequestConext that can be used as a base type for writing unit tests.
-
-
Constructor Summary
Constructors Constructor Description FakeRequestContext()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T extends RequestContext>
Tappend(T other)Always returnsother.<T extends BaseProxy>
Tcreate(java.lang.Class<T> clazz)Returnsnull.<T extends BaseProxy>
Tedit(T object)Always returnsobject.<P extends EntityProxy>
Request<P>find(EntityProxyId<P> proxyId)Returnsnull.voidfire()No-op.voidfire(Receiver<java.lang.Void> receiver)No-op.RequestFactorygetRequestFactory()Returnsnull.booleanisChanged()Always returnsfalse.
-
-
-
Method Detail
-
append
public <T extends RequestContext> T append(T other)
Always returnsother.- Specified by:
appendin interfaceRequestContext- Parameters:
other- a freshly-constructed RequestContext whose state should be bound to this RequestContext- Returns:
other
-
create
public <T extends BaseProxy> T create(java.lang.Class<T> clazz)
Returnsnull.- Specified by:
createin interfaceRequestContext- Parameters:
clazz- a Class object of type T- Returns:
- an
BaseProxyinstance of type T
-
edit
public <T extends BaseProxy> T edit(T object)
Always returnsobject.- Specified by:
editin interfaceRequestContext- Parameters:
object- an instance of type T- Returns:
- an
EntityProxyorValueProxyinstance of type T
-
find
public <P extends EntityProxy> Request<P> find(EntityProxyId<P> proxyId)
Returnsnull.- Specified by:
findin interfaceRequestContext- Parameters:
proxyId- anEntityProxyIdinstance of type P- Returns:
- a
Requestobject
-
fire
public void fire()
No-op.- Specified by:
firein interfaceRequestContext
-
fire
public void fire(Receiver<java.lang.Void> receiver)
No-op.- Specified by:
firein interfaceRequestContext- Parameters:
receiver- aReceiverinstance
-
getRequestFactory
public RequestFactory getRequestFactory()
Returnsnull.- Specified by:
getRequestFactoryin interfaceRequestContext
-
isChanged
public boolean isChanged()
Always returnsfalse.- Specified by:
isChangedin interfaceRequestContext- Returns:
trueif any changes have been made
-
-