title: Testing GWTP with Mockito
body: <p>I am using Mockito to test my GWTP project and I got some error:</p>
  
  <pre><code>    com.google.inject.CreationException: Guice creation errors:
  
  1) No implementation for javax.servlet.http.HttpServletRequest was bound.
    while locating com.google.inject.Provider&lt;javax.servlet.http.HttpServletRequest&gt;
      for parameter 0 at com.gwtplatform.dispatch.server.guice.request.DefaultRequestProvider.&lt;init&gt;(DefaultRequestProvider.java:35)
    at com.gwtplatform.dispatch.server.guice.DispatchModule.configure(DispatchModule.java:135)
  </code></pre>
  
  <p>Below is the code for unit test:</p>
  
  <pre><code>@Mock
  private TestActionHandler mockTestActionHandler;
  
  @Before
  public void setUp() {
      Injector injector = Guice.createInjector(new ServerModule(), new MockHandlerModule() {
  
          @Override
          protected void configureMockHandlers() {
                  bindMockActionHandler(TestActionHandler.class, 
                          mockTestActionHandler);
              }
          }); 
  }
  </code></pre>
  
  <p>Here is the code for TestActionHandler:</p>
  
  <pre><code>public class TestActionHandler implements ActionHandler&lt;TestAction, TestResult&gt; {
  
      private final Provider&lt;HttpServletRequest&gt; provider;
  
      @Inject
      public RetrieveEventsUsingCategoryIdActionHandler(
              final Provider&lt;HttpServletRequest&gt; provider) {
          this.provider = provider;
      }
  
      @Override
      public TestResult execute(TestAction action, ExecutionContext context) {
          //handle action
      }
  }
  </code></pre>
  
  <p>Could anyone help me fix this? Thaks a lot!</p>