package replicant;

import org.testng.annotations.Test;
import static org.testng.Assert.*;

public class ConvergerTest
  extends AbstractReplicantTest
{
  @Test
  public void construct_withUnnecessaryContext()
  {
    final ReplicantContext context = Replicant.context();
    final IllegalStateException exception =
      expectThrows( IllegalStateException.class, () -> Converger.create( context ) );
    assertEquals( exception.getMessage(),
                  "Replicant-0124: SubscriptioConvergernService passed a context but Replicant.areZonesEnabled() is false" );
  }

  @Test
  public void getReplicantContext()
  {
    final ReplicantContext context = Replicant.context();
    final Converger converger = context.getConverger();
    assertEquals( converger.getReplicantContext(), context );
    assertEquals( getFieldValue( converger, "_context" ), null );
  }
}

@@ -861,11 +861,396 @@
 l );%0A  %7D
+%0A%0A  @Test%0A  public void getReplicantContext_zonesEnabled()%0A  %7B%0A    ReplicantTestUtil.enableZones();%0A    ReplicantTestUtil.resetState();%0A%0A    final ReplicantContext context = Replicant.context();%0A    final Converger converger = context.getConverger();%0A    assertEquals( converger.getReplicantContext(), context );%0A    assertEquals( getFieldValue( converger, %22_context%22 ), context );%0A  %7D
 %0A%7D%0A

Add test for getReplicantContext with zones enabled