title: Testing Presenters in MVP GWT application
body: <p>I have a simple application and want to make it testable. I m new in this area.
  Here is a simple Presenter, taking in mind this code ,could you advice or give me some example how to test it.  </p>
  
  <pre><code>    public class SomePresenter extends Presenter&lt;MainPanelPresenter.Display&gt;
      {
  
      public interface Display extends WidgetDisplay
      {
        HasClickHandlers getAddButton();
  
        HasClickHandlers getDeleteButton();
  
        void setData(ArrayList&lt;Person&gt; data);
  
        ArrayList&lt;String&gt; getSelectedRows();
  
        Widget asWidget();
  
      }
  
      private final DispatchAsync dispatcher;
      public static final Place PLACE = new Place("main");
  
      @Inject
      public SomePresenter(DispatchAsync dispatcher, EventBus eventBus, Display display)
      {
        super(display, eventBus);
        this.dispatcher = dispatcher;
        bind();
      }
  
      protected void onBind()
      {
        display.getAddButton().addClickHandler(new ClickHandler()
        {
          public void onClick(ClickEvent event)
          {
            eventBus.fireEvent(new AddButtonEvent());
          }
        });
  
        display.getDeleteButton().addClickHandler(new ClickHandler()
        {
          public void onClick(ClickEvent event)
          {
            ArrayList&lt;String&gt; list = display.getSelectedRows();
            deletePerson(list);
          }
        });
      }
      ....
      private void loadDbData()
      {
       ..........
      }
      private void deletePerson(ArrayList&lt;String&gt; ids)
      {
       ..........
       }
     }
  </code></pre>
  
  <p>Edit:</p>
  
  <p>What does the Presenter is, load initial data from db, have 2 buttons add and delete.
  When add is press then a new form is load and user is able to input data and save to the db,
  delete button just delete person from db.</p>
  
  <p>Thanks</p>