Class AssertionLogMessage

java.lang.Object
de.qytera.qtaf.core.log.model.message.LogMessage
de.qytera.qtaf.core.log.model.message.AssertionLogMessage

public class AssertionLogMessage extends LogMessage
Entity class for assertion log messages.
  • Field Details

    • type

      protected AssertionLogMessageType type
      Type of assertion.
    • step

      protected transient StepInformationLogMessage step
      Step of assertion. This attribute needs to be transient so that it is ignored by JSON serializers. Otherwise, this causes a stack overflow, because it is a circular reference.
    • condition

      protected boolean condition
      Assertion condition.
    • actual

      protected Object actual
      Actual object.
    • expected

      protected Object expected
      Expected object.
  • Constructor Details

    • AssertionLogMessage

      public AssertionLogMessage(LogLevel level, String message)
      Constructor.
      Parameters:
      level - log level
      message - log message
  • Method Details

    • type

      public AssertionLogMessageType type()
      Returns the assertion's type.
      Returns:
      the type
    • setType

      Set the assertion's type.
      Parameters:
      type - the type
      Returns:
      the current assertion
    • step

      Returns the assertion's step.
      Returns:
      the step
    • setStep

      Set the step where the assertion was executed.
      Parameters:
      step - step log message
      Returns:
      this
    • condition

      public boolean condition()
      Returns the assertion's condition.
      Returns:
      the condition
    • setCondition

      public AssertionLogMessage setCondition(boolean condition)
      Set the assertion's condition.
      Parameters:
      condition - the condition
      Returns:
      the current assertion
    • actual

      public Object actual()
      Returns the assertion's actual object.
      Returns:
      the actual object
    • setActual

      public AssertionLogMessage setActual(Object actual)
      Set the actual object.
      Parameters:
      actual - the actual object
      Returns:
      the current assertion
    • expected

      public Object expected()
      Returns the assertion's expected object.
      Returns:
      the expected object
    • setExpected

      public AssertionLogMessage setExpected(Object expected)
      Set the expected object.
      Parameters:
      expected - the expected object
      Returns:
      the current assertion
    • error

      public ThrowableWrapper error()
      Returns the assertion's error.
      Returns:
      the error
    • setError

      public AssertionLogMessage setError(AssertionError error)
      Set the assertion's error.
      Parameters:
      error - the error
      Returns:
      the current assertion
    • wasExecuted

      public boolean wasExecuted()
      Returns whether the assertion was actually executed.
      Returns:
      true if it was executed, false otherwise
    • hasPassed

      public boolean hasPassed()
      Returns whether the assertion has passed.
      Overrides:
      hasPassed in class LogMessage
      Returns:
      true if it passed, false otherwise
    • hasFailed

      public boolean hasFailed()
      Returns whether the assertion has failed.
      Overrides:
      hasFailed in class LogMessage
      Returns:
      true if it failed, false otherwise
    • setStatusToPassed

      public AssertionLogMessage setStatusToPassed()
      Set the assertion status to passed.
      Returns:
      the current assertion
    • setStatusToFailed

      public AssertionLogMessage setStatusToFailed()
      Set the assertion status to failed.
      Returns:
      the current assertion