Class TestUtils

java.lang.Object
io.servicetalk.test.resources.TestUtils

public final class TestUtils extends Object
Test utility methods / helpers.
  • Method Details

    • assertNoAsyncErrors

      public static void assertNoAsyncErrors(Queue<? extends Throwable> errors)
      Helper method to check if a given Queue contains any errors, usually produced through async sources. For ALL Throwables found in the queue, a suppressed error will be captured and surface through a single AssertionError.
      Parameters:
      errors - The queue of captured errors.
    • assertNoAsyncErrors

      public static void assertNoAsyncErrors(String message, Queue<? extends Throwable> errors)
      Helper method to check if a given Queue contains any errors, usually produced through async sources. For ALL Throwables found in the queue, a suppressed error will be captured and surface through a single AssertionError.
      Parameters:
      message - message for the AssertionError.
      errors - The queue of captured errors.
    • matchThreadNamePrefix

      public static org.hamcrest.Matcher<Thread> matchThreadNamePrefix(String expectPrefix)
      Create a Matcher that matches the thread's name against and expected prefix value.
      Parameters:
      expectPrefix - the expected prefix value to match.
      Returns:
      a Matcher that matches the thread's name against and expected prefix value.