title: How to test that observer of org.jboss.seam.postInitialization works correctly
body: <p>I've created SEAM component which checks that at least one user with global admin rights exists and creates one if no.</p>
  
  <pre><code>@Name("installer")
  @Stateless
  public class InstallerBean implements Installer, Serializable{
     @Observer("org.jboss.seam.postInitialization")
     public void install() {
        ...
     }
  
     public boolean isInstalled() {
        ...
     }
  }
  </code></pre>
  
  <p>Now I need to test that installer works correctly. I need to check that isInstalled() returns true and check that correct users and roles are exists in the database. However SeamTest.ComponentTest.testComponents() is running before my installation compleate. I can see in the log that last messages from my installer appears in the middle of second test execution so my tests randomly fails.</p>
  
  <p>I'm trying to test my installer in the following way:</p>
  
  <pre><code>public class InstallerTests extends SeamTest {
      @Test
      public void isInstalledTest() {
          new ComponentTest() {
              @Override
              protected void testComponents() {
                 ...
              }
          }
      }
  
      ...
  }
  </code></pre>
  
  <p>How can I make my test starting after my installation compleated?</p>
  
  <p>I'm new to SEAM so maybe I'm doing all compleately wrong. Please tell me if there is a better way.</p>