com.google.web.bindery.requestfactory.shared.testing

## 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 and Description
    `FakeRequestContext()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `<T extends RequestContext> T` | `append(T other)` Always returns `other`.
    `<T extends BaseProxy> T` | `create(java.lang.Class<T> clazz)` Returns `null`.
    `<T extends BaseProxy> T` | `edit(T object)` Always returns `object`.
    `<P extends EntityProxy> Request<P>` | `find(EntityProxyId<P> proxyId)` Returns `null`.
    `void` | `fire()` No-op.
    `void` | `fire(Receiver<java.lang.Void> receiver)` No-op.
    `RequestFactory` | `getRequestFactory()` Returns `null`.
    `boolean` | `isChanged()` Always returns `false`.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### FakeRequestContext

          public FakeRequestContext()

  - ### Method Detail

    - #### append

          public <T extends RequestContext> T append(T other)

      Always returns `other`.
      Specified by:
        `append` in interface `RequestContext`
      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)

      Returns `null`.
      Specified by:
        `create` in interface `RequestContext`
      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 returns `object`.
      Specified by:
        `edit` in interface `RequestContext`
      Parameters:
        `object` - an instance of type T
      Returns:
        an `EntityProxy` or `ValueProxy` instance of type T

    - #### find

          public <P extends EntityProxy> Request<P> find(EntityProxyId<P> proxyId)

      Returns `null`.
      Specified by:
        `find` in interface `RequestContext`
      Parameters:
        `proxyId` - an `EntityProxyId` instance of type P
      Returns:
        a `Request` object

    - #### fire

          public void fire()

      No-op.
      Specified by:
        `fire` in interface `RequestContext`

    - #### fire

          public void fire(Receiver<java.lang.Void> receiver)

      No-op.
      Specified by:
        `fire` in interface `RequestContext`
      Parameters:
        `receiver` - a `Receiver` instance

    - #### getRequestFactory

          public RequestFactory getRequestFactory()

      Returns `null`.
      Specified by:
        `getRequestFactory` in interface `RequestContext`

    - #### isChanged

          public boolean isChanged()

      Always returns `false`.
      Specified by:
        `isChanged` in interface `RequestContext`
      Returns:
        `true` if any changes have been made