Class CommandResult

java.lang.Object
be.seeseemelk.mockbukkit.command.CommandResult

public class CommandResult extends Object
Represents the result of a command invocation.
  • Constructor Details

    • CommandResult

      @Internal public CommandResult(boolean success, @NotNull @NotNull MessageTarget sender)
      Constructs a new CommandResult with the provided parameters.
      Parameters:
      success - Whether the command succeeded (returned true).
      sender - The message target who executed the command.
  • Method Details

    • hasSucceeded

      public boolean hasSucceeded()
      Check if the command executed successfully.
      Returns:
      true if the command executed successfully, false if a problem occurred.
    • assertSucceeded

      public void assertSucceeded()
      Asserts if the returned code of the executed command is not true.
    • assertFailed

      public void assertFailed()
      Asserts if the returned code of the executed command is not false.
    • assertResponse

      public void assertResponse(String message)
      Assets if the given message was not the next message send to the command sender.
      Parameters:
      message - The message to check for.
      See Also:
    • assertResponse

      public void assertResponse(@NotNull @NotNull String format, Object... objects)
      Asserts if a given formatted message was not the next message sent to the command sender.
      Parameters:
      format - The formatted message to check for.
      objects - The objects to place into the formatted message.
      See Also:
    • assertNoResponse

      public void assertNoResponse()
      Asserts if more messages have been sent to the command sender.
      See Also: