Class InventoryAssert

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

public final class InventoryAssert extends org.assertj.core.api.AbstractAssert<InventoryAssert,InventorySnapshot>
Assertions over a frozen inventory snapshot, including occupied-slot and item navigation.
  • 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.
     
    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

    • items

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

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

      public InventoryAssert 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 InventoryAssert 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 InventoryAssert 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 InventoryAssert 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.