Class WeldEnvironment

  • All Implemented Interfaces:
    AutoCloseable

    public final class WeldEnvironment
    extends Object
    implements AutoCloseable
    Represents a Weld environment that was started for tests.
    Since:
    8.2.0
    • Method Detail

      • container

        public org.jboss.weld.environment.se.WeldContainer container()
        Gets the Weld container that was started for the test environment.
        Returns:
        The Weld container.
      • initiator

        public org.jboss.weld.junit5.WeldInitiator initiator()
        Gets the Weld initiator that was started for the test environment.
        Returns:
        The Weld initiator.
      • weld

        public org.jboss.weld.environment.se.Weld weld()
        Gets the Weld instance that was started for the test environment.
        Returns:
        The Weld instance.
      • awaitAsyncObservers

        public void awaitAsyncObservers​(Duration timeout)
                                 throws InterruptedException,
                                        TimeoutException
        Waits until all asynchronous observers (@ObservesAsync) have finished, including observers of events that were fired asynchronously while waiting.
        Parameters:
        timeout - Maximum time to wait.
        Throws:
        InterruptedException - When the current thread was interrupted while waiting.
        TimeoutException - When asynchronous observers are still pending or running after the timeout.
        Since:
        8.6.0