package org.realityforge.gwt.eventsource.client;

import com.google.web.bindery.event.shared.EventBus;
import com.google.web.bindery.event.shared.SimpleEventBus;
import javax.annotation.Nonnull;

public final class TestEventSource
  extends EventSource
{
  static class Factory
    implements EventSource.Factory
  {
    @Override
    public EventSource newEventSource()
    {
      return new TestEventSource( new SimpleEventBus() );
    }
  }

  public TestEventSource( final EventBus eventBus )
  {
    super( eventBus );
  }

  @Override
  public void open( @Nonnull final String url, final boolean withCredentials )
  {
  }

  @Override
  public boolean subscribeTo( @Nonnull final String messageType )
    throws IllegalStateException
  {
    return false;
  }

  @Override
  public boolean unsubscribeFrom( @Nonnull final String messageType )
    throws IllegalStateException
  {
    return false;
  }

  @Override
  @Nonnull
  public String getURL()
  {
    return "";
  }

  @Override
  public boolean getWithCredentials()
  {
    return false;
  }

  @Override
  public void close()
  {
  }

  @Nonnull
  @Override
  public ReadyState getReadyState()
  {
    return ReadyState.CLOSED;
  }
}

package org.realityforge.gwt.eventsource.client;

import com.google.web.bindery.event.shared.EventBus;
import com.google.web.bindery.event.shared.SimpleEventBus;
import javax.annotation.Nonnull;

final class TestEventSource
  extends EventSource
{
  static class Factory
    implements EventSource.Factory
  {
    @Override
    public EventSource newEventSource()
    {
      return new TestEventSource( new SimpleEventBus() );
    }
  }

  TestEventSource( final EventBus eventBus )
  {
    super( eventBus );
  }

  @Override
  public void open( @Nonnull final String url, final boolean withCredentials )
  {
  }

  @Override
  public boolean subscribeTo( @Nonnull final String messageType )
    throws IllegalStateException
  {
    return false;
  }

  @Override
  public boolean unsubscribeFrom( @Nonnull final String messageType )
    throws IllegalStateException
  {
    return false;
  }

  @Override
  @Nonnull
  public String getURL()
  {
    return "";
  }

  @Override
  public boolean getWithCredentials()
  {
    return false;
  }

  @Override
  public void close()
  {
  }

  @Nonnull
  @Override
  public ReadyState getReadyState()
  {
    return ReadyState.CLOSED;
  }
}

--- 
+++ 
@@ -4,7 +4,7 @@
 import com.google.web.bindery.event.shared.SimpleEventBus;
 import javax.annotation.Nonnull;
 
-final class TestEventSource
+public final class TestEventSource
   extends EventSource
 {
   static class Factory
@@ -17,7 +17,7 @@
     }
   }
 
-  TestEventSource( final EventBus eventBus )
+  public TestEventSource( final EventBus eventBus )
   {
     super( eventBus );
   }
Make the class public to use from other packages
