Class NativeValidationsBuilder

java.lang.Object
com.shaft.validation.internal.NativeValidationsBuilder
Direct Known Subclasses:
JSONValidationsBuilder

public class NativeValidationsBuilder extends Object
  • Constructor Details

  • Method Details

    • isEqualTo

      public ValidationsExecutor isEqualTo(Object expectedValue)
      Use this to check that the actual object is equal to the expected value
      Parameters:
      expectedValue - the test data / expected value for the object under test
      Returns:
      a ValidationsExecutor object to set your custom validation message (if needed) and then perform() your validation
    • equals

      public boolean equals(Object expectedValue)
      Overrides the default object method equals and is the same as calling isEqualTo(expectedValue).perform();
      Overrides:
      equals in class Object
      Parameters:
      expectedValue - the test data / expected value for the object under test
      Returns:
      boolean value true if passed and throws AssertionError if failed (return value can be safely ignored)
    • doesNotEqual

      public ValidationsExecutor doesNotEqual(Object expectedValue)
      Use this to check that the actual object is not equal to the expected value
      Parameters:
      expectedValue - the test data / expected value for the object under test
      Returns:
      a ValidationsExecutor object to set your custom validation message (if needed) and then perform() your validation
    • contains

      public ValidationsExecutor contains(Object expectedValue)
      Use this to check that the actual object contains the expected value
      Parameters:
      expectedValue - the test data / expected value for the object under test
      Returns:
      a ValidationsExecutor object to set your custom validation message (if needed) and then perform() your validation
    • doesNotContain

      public ValidationsExecutor doesNotContain(Object expectedValue)
      Use this to check that the actual object does not contain the expected value
      Parameters:
      expectedValue - the test data / expected value for the object under test
      Returns:
      a ValidationsExecutor object to set your custom validation message (if needed) and then perform() your validation
    • matchesRegex

      public ValidationsExecutor matchesRegex(Object expectedValue)
      Use this to check that the actual object matches the expected regular expression
      Parameters:
      expectedValue - the test data / expected regular expression for the object under test
      Returns:
      a ValidationsExecutor object to set your custom validation message (if needed) and then perform() your validation
    • doesNotMatchRegex

      public ValidationsExecutor doesNotMatchRegex(Object expectedValue)
      Use this to check that the actual object does not match the expected regular expression
      Parameters:
      expectedValue - the test data / expected regular expression for the object under test
      Returns:
      a ValidationsExecutor object to set your custom validation message (if needed) and then perform() your validation
    • equalsIgnoringCaseSensitivity

      public ValidationsExecutor equalsIgnoringCaseSensitivity(Object expectedValue)
      Use this to check that the actual object is equal to the expected value (ignoring case sensitivity)
      Parameters:
      expectedValue - the test data / expected value for the object under test
      Returns:
      a ValidationsExecutor object to set your custom validation message (if needed) and then perform() your validation
    • doesNotEqualIgnoringCaseSensitivity

      public ValidationsExecutor doesNotEqualIgnoringCaseSensitivity(Object expectedValue)
      Use this to check that the actual object is not equal to the expected value (ignoring case sensitivity)
      Parameters:
      expectedValue - the test data / expected value for the object under test
      Returns:
      a ValidationsExecutor object to set your custom validation message (if needed) and then perform() your validation
    • isNull

      public ValidationsExecutor isNull()
      Use this to check that the actual object is null
      Returns:
      a ValidationsExecutor object to set your custom validation message (if needed) and then perform() your validation
    • isNotNull

      public ValidationsExecutor isNotNull()
      Use this to check that the actual object is not null
      Returns:
      a ValidationsExecutor object to set your custom validation message (if needed) and then perform() your validation
    • isTrue

      public ValidationsExecutor isTrue()
      Use this to check that the actual object is true
      Returns:
      a ValidationsExecutor object to set your custom validation message (if needed) and then perform() your validation
    • isFalse

      public ValidationsExecutor isFalse()
      Use this to check that the actual object is false
      Returns:
      a ValidationsExecutor object to set your custom validation message (if needed) and then perform() your validation
    • language

      public TextLanguageValidationsBuilder language()
      Use this under text assertions to validate text language.
      Returns:
      a TextLanguageValidationsBuilder object to continue building language validations
      Throws:
      IllegalStateException - if called outside text-based assertions
    • direction

      public TextDirectionValidationsBuilder direction()
      Use this under text assertions to validate text direction as LTR/RTL.
      Returns:
      a TextDirectionValidationsBuilder object to continue building direction validations
      Throws:
      IllegalStateException - if called outside text-based assertions
    • alignment

      public TextDirectionValidationsBuilder alignment()
      Use this under text assertions to validate text alignment as LTR/RTL.
      Returns:
      a TextDirectionValidationsBuilder object to continue building alignment validations
      Throws:
      IllegalStateException - if called outside text-based assertions
    • orientation

      public TextDirectionValidationsBuilder orientation()
      Use this under text assertions to validate text orientation as LTR/RTL.
      Returns:
      a TextDirectionValidationsBuilder object to continue building orientation validations
      Throws:
      IllegalStateException - if called outside text-based assertions
    • displayStyle

      public TextDirectionValidationsBuilder displayStyle()
      Use this under text assertions to validate text display style as LTR/RTL.
      Returns:
      a TextDirectionValidationsBuilder object to continue building display style validations
      Throws:
      IllegalStateException - if called outside text-based assertions
    • isArabic

      public ValidationsExecutor isArabic()
      Convenience method that validates Arabic text characters and RTL direction.
      Returns:
      a ValidationsExecutor object to set your custom validation message (if needed) and then perform() your validation
      Throws:
      IllegalStateException - if called outside text-based assertions