Class NativeValidationsBuilder

java.lang.Object
com.shaft.validation.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