Class LightkeeperFrameworkAssert

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

public final class LightkeeperFrameworkAssert extends org.assertj.core.api.AbstractAssert<LightkeeperFrameworkAssert,@Nullable ILightkeeperFramework>
Assertions for framework-level runtime state.
  • Field Summary

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

    info, throwUnsupportedExceptionOnEquals
  • Method Summary

    Modifier and Type
    Method
    Description
    Asserts that no error-severity server errors were captured.
    Asserts that no error-severity server errors were captured, ignoring entries matched by the allowlist.
    Asserts that the server is running on Paper.
    Asserts that the server is running on Spigot.
    Navigates to eager assertions over the framework's live server.
    org.assertj.core.api.ListAssert<String>
    Returns an AssertJ list assertion over captured server output.

    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

    • server

      public ServerControlAssert server()
      Navigates to eager assertions over the framework's live server.
      Returns:
      Server assertions, including named plugin assertions.
    • serverOutput

      public org.assertj.core.api.ListAssert<String> serverOutput()
      Returns an AssertJ list assertion over captured server output.
      Returns:
      AssertJ list assertion for captured server output lines.
    • isPaper

      public LightkeeperFrameworkAssert isPaper()
      Asserts that the server is running on Paper.
      Returns:
      This assertion for fluent chaining.
    • isSpigot

      public LightkeeperFrameworkAssert isSpigot()
      Asserts that the server is running on Spigot.
      Returns:
      This assertion for fluent chaining.
    • hasNoServerErrors

      public LightkeeperFrameworkAssert hasNoServerErrors()
      Asserts that no error-severity server errors were captured.

      Backed by structured capture (see IServerControl.errors()): entries are matched on their captured severity, not on console-line substrings, so a log message merely containing the word "exception" no longer trips this assertion. Warnings are never counted.

      Returns:
      This assertion for fluent chaining.
    • hasNoServerErrors

      public LightkeeperFrameworkAssert hasNoServerErrors(Predicate<ServerErrorSnapshot> allowedErrors)
      Asserts that no error-severity server errors were captured, ignoring entries matched by the allowlist.

      Use the allowlist for known-benign errors, matching on structured fields rather than console text:

      
       assertThat(framework).hasNoServerErrors(error ->
           error.loggerName().equals("net.minecraft.server")
               && error.message().contains("moving_piston"));
       
      Parameters:
      allowedErrors - Predicate matching captured errors that should not fail this assertion.
      Returns:
      This assertion for fluent chaining.