Class LightkeeperAssertions

java.lang.Object
org.assertj.core.api.Assertions
nl.pim16aap2.lightkeeper.framework.assertions.LightkeeperAssertions
All Implemented Interfaces:
org.assertj.core.api.InstanceOfAssertFactories

public final class LightkeeperAssertions extends org.assertj.core.api.Assertions
AssertJ entrypoints for LightKeeper handles.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static interface 
    An assertion that eventually(Duration, RetryingAssertion) re-runs until it passes.
  • Field Summary

    Fields inherited from interface org.assertj.core.api.InstanceOfAssertFactories

    ARRAY, ARRAY_2D, ATOMIC_BOOLEAN, ATOMIC_INTEGER, ATOMIC_INTEGER_ARRAY, ATOMIC_INTEGER_FIELD_UPDATER, ATOMIC_LONG, ATOMIC_LONG_ARRAY, ATOMIC_LONG_FIELD_UPDATER, ATOMIC_MARKABLE_REFERENCE, ATOMIC_REFERENCE, ATOMIC_REFERENCE_ARRAY, ATOMIC_REFERENCE_FIELD_UPDATER, ATOMIC_STAMPED_REFERENCE, BIG_DECIMAL, BIG_INTEGER, BOOLEAN, BOOLEAN_2D_ARRAY, BOOLEAN_ARRAY, BYTE, BYTE_2D_ARRAY, BYTE_ARRAY, CHAR_2D_ARRAY, CHAR_ARRAY, CHAR_SEQUENCE, CHARACTER, CLASS, COLLECTION, COMPLETABLE_FUTURE, COMPLETION_STAGE, DATE, DOUBLE, DOUBLE_2D_ARRAY, DOUBLE_ARRAY, DOUBLE_PREDICATE, DOUBLE_STREAM, DURATION, FILE, FLOAT, FLOAT_2D_ARRAY, FLOAT_ARRAY, FUTURE, INPUT_STREAM, INSTANT, INT_2D_ARRAY, INT_ARRAY, INT_PREDICATE, INT_STREAM, INTEGER, ITERABLE, ITERATOR, LIST, LOCAL_DATE, LOCAL_DATE_TIME, LOCAL_TIME, LONG, LONG_2D_ARRAY, LONG_ADDER, LONG_ARRAY, LONG_PREDICATE, LONG_STREAM, MAP, MATCHER, OFFSET_DATE_TIME, OFFSET_TIME, OPTIONAL, OPTIONAL_DOUBLE, OPTIONAL_INT, OPTIONAL_LONG, PATH, PERIOD, PREDICATE, SET, SHORT, SHORT_2D_ARRAY, SHORT_ARRAY, SPLITERATOR, STREAM, STRING, STRING_BUFFER, STRING_BUILDER, TEMPORAL, THROWABLE, URI_TYPE, URL_TYPE, YEAR_MONTH, ZONED_DATE_TIME
  • Method Summary

    Modifier and Type
    Method
    Description
    assertThat(@Nullable BlockRef actual)
     
    assertThat(@Nullable BlockStateSnapshot actual)
     
    Creates frozen typed-event assertions.
     
    assertThat(@Nullable CommandResult actual)
    Creates command dispatch result assertions.
    assertThat(@Nullable EntityQuery actual)
     
    assertThat(@Nullable EntitySnapshot actual)
     
    assertThat(@Nullable EventCaptureHandle actual)
    Creates live event-capture assertions.
    Creates an assertion chain for framework-level runtime state.
    assertThat(@Nullable InteractionResult actual)
    Creates interaction outcome assertions.
    assertThat(@Nullable InventorySnapshot actual)
    Creates assertions over a frozen inventory.
    assertThat(@Nullable MenuHandle actual)
    Creates an assertion chain for menu-related state.
    assertThat(@Nullable MenuItemSnapshot actual)
    Creates assertions over a frozen item.
    assertThat(@Nullable MenuSnapshot actual)
    Creates assertions over a frozen menu.
    assertThat(@Nullable PlayerHandle actual)
    Creates an assertion chain for player-related state.
    assertThat(@Nullable ServerErrorsHandle actual)
    Creates live structured-error assertions.
    static Vec3Assert
    assertThat(@Nullable Vec3 actual)
     
    assertThat(@Nullable WorldHandle actual)
    Creates an assertion chain for world-related state.
     
    assertThat(@Nullable IProtocolValue actual)
    Creates frozen typed-value assertions.
    static void
    Retries an assertion until it passes or the timeout expires.

    Methods inherited from class org.assertj.core.api.Assertions

    allOf, allOf, allOf, anyOf, anyOf, anyOf, as, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThatCharSequence, assertThatCode, assertThatCollection, assertThatComparable, assertThatException, assertThatExceptionOfType, assertThatIllegalArgumentException, assertThatIllegalStateException, assertThatIndexOutOfBoundsException, assertThatIOException, assertThatIterable, assertThatIterator, assertThatList, assertThatNoException, assertThatNullPointerException, assertThatObject, assertThatPath, assertThatPredicate, assertThatReflectiveOperationException, assertThatRuntimeException, assertThatStream, assertThatTemporal, assertThatThrownBy, assertThatThrownBy, assertWith, atIndex, byLessThan, byLessThan, byLessThan, byLessThan, byLessThan, byLessThan, byLessThan, byLessThan, byLessThan, byLessThan, catchException, catchIllegalArgumentException, catchIllegalStateException, catchIndexOutOfBoundsException, catchIOException, catchNullPointerException, catchReflectiveOperationException, catchRuntimeException, catchThrowable, catchThrowableOfType, catchThrowableOfType, contentOf, contentOf, contentOf, contentOf, contentOf, contentOf, doesNotHave, entry, extractProperty, extractProperty, fail, fail, fail, fail, fail, failBecauseExceptionWasNotThrown, filter, filter, from, in, linesOf, linesOf, linesOf, linesOf, linesOf, linesOf, linesOf, linesOf, linesOf, not, not, notIn, offset, offset, registerCustomDateFormat, registerCustomDateFormat, registerFormatterForType, setAllowComparingPrivateFields, setAllowExtractingPrivateFields, setDescriptionConsumer, setExtractBareNamePropertyMethods, setLenientDateParsing, setMaxElementsForPrinting, setMaxLengthForSingleLineDescription, setMaxStackTraceElementsDisplayed, setPrintAssertionsDescription, setRemoveAssertJRelatedElementsFromStackTrace, shouldHaveThrown, tuple, useDefaultDateFormatsOnly, useDefaultRepresentation, useRepresentation, within, within, within, within, within, within, within, within, within, within, withinPercentage, withinPercentage, withinPercentage, withMarginOf, withPrecision, withPrecision

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • assertThat

      public static ChatComponentAssert assertThat(@Nullable ChatComponentSnapshot actual)
      Parameters:
      actual - Frozen native chat component.
      Returns:
      Literal-text and effective-click assertions.
    • assertThat

      public static BlockRefAssert assertThat(@Nullable BlockRef actual)
      Parameters:
      actual - Live block address.
      Returns:
      Eager block assertions.
    • assertThat

      public static BlockStateSnapshotAssert assertThat(@Nullable BlockStateSnapshot actual)
      Parameters:
      actual - Frozen block state.
      Returns:
      Partial-state assertions.
    • assertThat

      public static EntityQueryAssert assertThat(@Nullable EntityQuery actual)
      Parameters:
      actual - Live entity query.
      Returns:
      Eager query assertions.
    • assertThat

      public static EntitySnapshotAssert assertThat(@Nullable EntitySnapshot actual)
      Parameters:
      actual - Frozen entity observation.
      Returns:
      Position and transform assertions.
    • assertThat

      public static EntityTransformAssert assertThat(@Nullable EntitySnapshot.Transform actual)
      Parameters:
      actual - Frozen display transformation.
      Returns:
      Transform navigation.
    • assertThat

      public static Vec3Assert assertThat(@Nullable Vec3 actual)
      Parameters:
      actual - Frozen vector.
      Returns:
      Explicit tolerance comparisons.
    • assertThat

      public static CommandResultAssert assertThat(@Nullable CommandResult actual)
      Creates command dispatch result assertions.
      Parameters:
      actual - Returned result.
      Returns:
      Frozen command assertions.
    • assertThat

      public static InteractionResultAssert assertThat(@Nullable InteractionResult actual)
      Creates interaction outcome assertions.
      Parameters:
      actual - Returned result.
      Returns:
      Frozen interaction assertions.
    • assertThat

      public static ServerErrorsAssert assertThat(@Nullable ServerErrorsHandle actual)
      Creates live structured-error assertions.
      Parameters:
      actual - Error capture handle.
      Returns:
      Error/warning assertions.
    • assertThat

      public static EventCaptureAssert assertThat(@Nullable EventCaptureHandle actual)
      Creates live event-capture assertions.
      Parameters:
      actual - Capture handle.
      Returns:
      Capture assertions.
    • assertThat

      public static CapturedEventAssert assertThat(@Nullable CapturedEventSnapshot actual)
      Creates frozen typed-event assertions.
      Parameters:
      actual - Captured event.
      Returns:
      Event assertions.
    • assertThat

      public static ProtocolValueAssert assertThat(@Nullable IProtocolValue actual)
      Creates frozen typed-value assertions.
      Parameters:
      actual - Captured typed value.
      Returns:
      Value assertions.
    • assertThat

      public static InventoryAssert assertThat(@Nullable InventorySnapshot actual)
      Creates assertions over a frozen inventory.
      Parameters:
      actual - Captured inventory.
      Returns:
      Inventory assertions.
    • assertThat

      public static MenuSnapshotAssert assertThat(@Nullable MenuSnapshot actual)
      Creates assertions over a frozen menu.
      Parameters:
      actual - Captured menu.
      Returns:
      Menu snapshot assertions.
    • assertThat

      public static MenuItemSnapshotAssert assertThat(@Nullable MenuItemSnapshot actual)
      Creates assertions over a frozen item.
      Parameters:
      actual - Captured item.
      Returns:
      Item snapshot assertions.
    • assertThat

      public static WorldHandleAssert assertThat(@Nullable WorldHandle actual)
      Creates an assertion chain for world-related state.
      Parameters:
      actual - World handle under test.
      Returns:
      World assertion entrypoint.
    • assertThat

      public static MenuHandleAssert assertThat(@Nullable MenuHandle actual)
      Creates an assertion chain for menu-related state.
      Parameters:
      actual - Menu handle under test.
      Returns:
      Menu assertion entrypoint.
    • assertThat

      public static PlayerHandleAssert assertThat(@Nullable PlayerHandle actual)
      Creates an assertion chain for player-related state.
      Parameters:
      actual - Player handle under test.
      Returns:
      Player assertion entrypoint.
    • assertThat

      public static LightkeeperFrameworkAssert assertThat(@Nullable ILightkeeperFramework actual)
      Creates an assertion chain for framework-level runtime state.
      Parameters:
      actual - Framework under test.
      Returns:
      Framework assertion entrypoint.
    • eventually

      public static void eventually(Duration timeout, LightkeeperAssertions.RetryingAssertion assertion)
      Retries an assertion until it passes or the timeout expires.

      Eager assertions never poll; this is the visible opt-in retry over the exact same assertion. The assertion is re-run in full — probe and matcher — every 50 ms, so it only makes sense over LIVE subjects that re-query the server per call (block types, inventories, menus, messages, server errors); retrying a frozen snapshot can never change the outcome and simply burns the timeout.

      On timeout, the thrown AssertionError carries the retry history (attempt count and elapsed time) and the last attempt's failure as its cause — strictly more information than a generic "condition not met". A non-assertion exception (e.g. a closed framework) fails fast on the first occurrence instead of burning the timeout; nesting eventually inside eventually is detected and rejected.

      Parameters:
      timeout - Maximum time to keep retrying; must be positive.
      assertion - The assertion to retry, typically a lambda re-running an eager assertThat(...) chain.