@@ -0,0 +1,800 @@
+package arez.integration;%0A%0Aimport arez.ArezContext;%0Aimport arez.annotations.ArezComponent;%0Aimport arez.annotations.ContextRef;%0Aimport org.testng.annotations.Test;%0Aimport static org.testng.Assert.*;%0A%0Apublic class ContextRefReferencedInCtorTest%0A  extends AbstractIntegrationTest%0A%7B%0A  @ArezComponent( allowEmpty = true )%0A  static abstract class TestComponent%0A  %7B%0A    TestComponent()%0A    %7B%0A      getContext();%0A    %7D%0A%0A    @ContextRef%0A    abstract ArezContext getContext();%0A  %7D%0A%0A  @Test%0A  public void scenario()%0A    throws Throwable%0A  %7B%0A    final IllegalStateException exception =%0A      expectThrows( IllegalStateException.class, ContextRefReferencedInCtorTest_Arez_TestComponent::new );%0A    assertEquals( exception.getMessage(), %22Method invoked on uninitialized component of type 'TestComponent'%22 );%0A  %7D%0A%7D%0A

Add integration test to verify that invariant is correctly generated