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
Constructors -
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.voidfire()No-op.voidNo-op.Returnsnull.booleanAlways returnsfalse.
-
Constructor Details
-
FakeRequestContext
public FakeRequestContext()
-
-
Method Details
-
append
Always returnsother.- Specified by:
appendin interfaceRequestContext- Parameters:
other- a freshly-constructed RequestContext whose state should be bound to this RequestContext- Returns:
other
-
create
Returnsnull.- Specified by:
createin interfaceRequestContext- Parameters:
clazz- a Class object of type T- Returns:
- an
BaseProxyinstance of type T
-
edit
Always returnsobject.- Specified by:
editin interfaceRequestContext- Parameters:
object- an instance of type T- Returns:
- an
EntityProxyorValueProxyinstance of type T
-
fire
public void fire()No-op.- Specified by:
firein interfaceRequestContext
-
getRequestFactory
Returnsnull.- Specified by:
getRequestFactoryin interfaceRequestContext
-
isChanged
public boolean isChanged()Always returnsfalse.- Specified by:
isChangedin interfaceRequestContext- Returns:
trueif any changes have been made
-