Class MenuHandleAssert

java.lang.Object
org.assertj.core.api.AbstractAssert<MenuHandleAssert,MenuHandle>
nl.pim16aap2.lightkeeper.framework.assertions.MenuHandleAssert
All Implemented Interfaces:
org.assertj.core.api.Assert<MenuHandleAssert,MenuHandle>, org.assertj.core.api.Descriptable<MenuHandleAssert>, org.assertj.core.api.ExtensionPoints<MenuHandleAssert,MenuHandle>

public final class MenuHandleAssert extends org.assertj.core.api.AbstractAssert<MenuHandleAssert,MenuHandle>
Eager assertions over the current menu for a retained player-bound handle.
  • Field Summary

    Fields inherited from class org.assertj.core.api.AbstractAssert

    info, throwUnsupportedExceptionOnEquals
  • Method Summary

    Modifier and Type
    Method
    Description
    hasEmptySlot(int slot)
    Checks that no non-air item was observed at a slot.
    hasItemAt(int slot, String materialKey)
    Checks a slot's material.
    hasItemAt(int slot, org.bukkit.inventory.ItemStack expected)
    Compares represented item fields, excluding amount and unobserved metadata.
    hasOccupiedSlotCount(int expected)
    Checks occupied slots rather than total item units.
    hasTitle(String expectedTitle)
    Checks an open menu's exact title in one observation.
     
     
     
    itemAt(int slot)
    Selects an occupied slot from one snapshot.
    org.assertj.core.api.ListAssert<MenuItemSnapshot>
     
     

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

    actual, asInstanceOf, asList, asString, describedAs, descriptionText, doesNotHave, doesNotHaveSameClassAs, doesNotHaveSameHashCodeAs, doesNotHaveToString, doesNotHaveToString, doesNotMatch, doesNotMatch, equals, getWritableAssertionInfo, has, hashCode, hasSameClassAs, hasSameHashCodeAs, hasToString, hasToString, is, isEqualTo, isExactlyInstanceOf, isIn, isIn, isInstanceOf, isInstanceOfAny, isInstanceOfSatisfying, isNot, isNotEqualTo, isNotExactlyInstanceOf, isNotIn, isNotIn, isNotInstanceOf, isNotInstanceOfAny, isNotNull, isNotOfAnyClassIn, isNotSameAs, isNull, isOfAnyClassIn, isSameAs, matches, matches, overridingErrorMessage, overridingErrorMessage, satisfies, satisfies, satisfies, satisfiesAnyOf, satisfiesAnyOf, setCustomRepresentation, setDescriptionConsumer, setPrintAssertionsDescription, usingComparator, usingComparator, usingDefaultComparator, usingEquals, usingEquals, withFailMessage, withFailMessage, withRepresentation, withThreadDumpOnError

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.assertj.core.api.Descriptable

    as, as, as, describedAs, describedAs
  • Method Details

    • snapshot

      public MenuSnapshotAssert snapshot()
      Returns:
      Frozen assertions over one menu observation; recreate navigation when retrying.
    • isOpen

      public MenuHandleAssert isOpen()
      Returns:
      This assertion after checking that the menu is open.
    • isClosed

      public MenuHandleAssert isClosed()
      Returns:
      This assertion after checking that the retained menu is closed; null subjects fail.
    • hasTitle

      public MenuHandleAssert hasTitle(String expectedTitle)
      Checks an open menu's exact title in one observation.
      Parameters:
      expectedTitle - Expected title.
      Returns:
      This assertion.
    • items

      public org.assertj.core.api.ListAssert<MenuItemSnapshot> items()
      Returns:
      Frozen item-list assertions; recreate navigation when retrying.
    • isEmpty

      public MenuHandleAssert isEmpty()
      Returns:
      This assertion after checking that no non-air items are present.
    • hasOccupiedSlotCount

      public MenuHandleAssert hasOccupiedSlotCount(int expected)
      Checks occupied slots rather than total item units.
      Parameters:
      expected - Expected nonnegative occupied-slot count.
      Returns:
      This assertion.
    • itemAt

      public MenuItemSnapshotAssert itemAt(int slot)
      Selects an occupied slot from one snapshot.
      Parameters:
      slot - Nonnegative slot index.
      Returns:
      Frozen item assertions.
    • hasEmptySlot

      public MenuHandleAssert hasEmptySlot(int slot)
      Checks that no non-air item was observed at a slot.

      The snapshot does not expose capacity, so an empty slot does not establish upper-bound validity.

      Parameters:
      slot - Nonnegative slot index.
      Returns:
      This assertion.
    • hasItemAt

      public MenuHandleAssert hasItemAt(int slot, String materialKey)
      Checks a slot's material.
      Parameters:
      slot - Nonnegative slot index.
      materialKey - Material name or namespaced key.
      Returns:
      This assertion.
    • hasItemAt

      public MenuHandleAssert hasItemAt(int slot, org.bukkit.inventory.ItemStack expected)
      Compares represented item fields, excluding amount and unobserved metadata.
      Parameters:
      slot - Nonnegative slot index.
      expected - Expected Bukkit item.
      Returns:
      This assertion.