Class ClientAndServer

    • Method Detail

      • openUI

        public ClientAndServer openUI()
        Launch UI and wait the default period to allow the UI to launch and start collecting logs, this ensures that the log are visible in the UI even if MockServer is shutdown by a test shutdown function, such as After, AfterClass, AfterAll, etc
        Overrides:
        openUI in class MockServerClient
      • openUI

        public ClientAndServer openUI​(TimeUnit timeUnit,
                                      long pause)
        Launch UI and wait a specified period to allow the UI to launch and start collecting logs, this ensures that the log are visible in the UI even if MockServer is shutdown by a test shutdown function, such as After, AfterClass, AfterAll, etc
        Overrides:
        openUI in class MockServerClient
        Parameters:
        timeUnit - TimeUnit the time unit, for example TimeUnit.SECONDS
        pause - the number of time units to delay before the function returns to ensure the UI is receiving logs
      • isRunning

        public boolean isRunning()
        Description copied from class: MockServerClient
        Returns whether MockServer is running, if called too quickly after starting MockServer this may return false because MockServer has not yet started, to ensure MockServer has started use hasStarted()
        Overrides:
        isRunning in class MockServerClient
      • hasStarted

        public boolean hasStarted()
        Description copied from class: MockServerClient
        Returns whether MockServer has started, if called after MockServer has been stopped this method will block for 5 seconds while confirming MockServer is not starting
        Overrides:
        hasStarted in class MockServerClient
      • stop

        public void stop()
        Description copied from class: MockServerClient
        Stop MockServer gracefully (only support for Netty version, not supported for WAR version)
        Specified by:
        stop in interface Stoppable
        Overrides:
        stop in class MockServerClient
      • getLocalPort

        public Integer getLocalPort()
      • setLogEventListener

        public static void setLogEventListener​(Consumer<LogEntry> listener)