Class FakeRequestContext
java.lang.Object
com.google.web.bindery.requestfactory.shared.testing.FakeRequestContext
- All Implemented Interfaces:
RequestContext
A no-op implementation of RequestConext that can be used as a base type for
writing unit tests.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription<T extends RequestContext>
Tappend
(T other) Always returnsother
.<T extends BaseProxy>
TReturnsnull
.<T extends BaseProxy>
Tedit
(T object) Always returnsobject
.<P extends EntityProxy>
Request<P> find
(EntityProxyId<P> proxyId) Returnsnull
.void
fire()
No-op.void
No-op.Returnsnull
.boolean
Always returnsfalse
.
-
Constructor Details
-
FakeRequestContext
public FakeRequestContext()
-
-
Method Details
-
append
Always returnsother
.- Specified by:
append
in interfaceRequestContext
- Parameters:
other
- a freshly-constructed RequestContext whose state should be bound to this RequestContext- Returns:
other
-
create
Returnsnull
.- Specified by:
create
in interfaceRequestContext
- Parameters:
clazz
- a Class object of type T- Returns:
- an
BaseProxy
instance of type T
-
edit
Always returnsobject
.- Specified by:
edit
in interfaceRequestContext
- Parameters:
object
- an instance of type T- Returns:
- an
EntityProxy
orValueProxy
instance of type T
-
fire
public void fire()No-op.- Specified by:
fire
in interfaceRequestContext
-
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
-