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
.void
fire()
No-op.void
fire(Receiver<java.lang.Void> receiver)
No-op.RequestFactory
getRequestFactory()
Returnsnull
.boolean
isChanged()
Always returnsfalse
.
-
-
-
Method Detail
-
append
public <T extends RequestContext> T append(T other)
Always returnsother
.- Specified by:
append
in 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:
create
in interfaceRequestContext
- Parameters:
clazz
- a Class object of type T- Returns:
- an
BaseProxy
instance of type T
-
edit
public <T extends BaseProxy> T edit(T object)
Always returnsobject
.- Specified by:
edit
in interfaceRequestContext
- Parameters:
object
- an instance of type T- Returns:
- an
EntityProxy
orValueProxy
instance of type T
-
find
public <P extends EntityProxy> Request<P> find(EntityProxyId<P> proxyId)
Returnsnull
.- Specified by:
find
in interfaceRequestContext
- Parameters:
proxyId
- anEntityProxyId
instance of type P- Returns:
- a
Request
object
-
fire
public void fire()
No-op.- Specified by:
fire
in interfaceRequestContext
-
fire
public void fire(Receiver<java.lang.Void> receiver)
No-op.- Specified by:
fire
in interfaceRequestContext
- Parameters:
receiver
- aReceiver
instance
-
getRequestFactory
public RequestFactory getRequestFactory()
Returnsnull
.- Specified by:
getRequestFactory
in interfaceRequestContext
-
isChanged
public boolean isChanged()
Always returnsfalse
.- Specified by:
isChanged
in interfaceRequestContext
- Returns:
true
if any changes have been made
-
-